Advertisement
Guest User

Untitled

a guest
Jun 13th, 2018
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.36 KB | None | 0 0
  1. temp = [dftt['ds'], dftt.columns[2]]
  2. df_temp = pd.DataFrame(data = temp)
  3.  
  4. Error is:
  5. ---------------------------------------------------------------------------
  6. AttributeError Traceback (most recent call last)
  7. <ipython-input-21-9d324ce0f7e1> in <module>()
  8. 1 temp = [dftt['ds'], dftt.columns[2]]
  9. ----> 2 df_temp = pd.DataFrame(data = temp)
  10.  
  11. /opt/conda/envs/fastai/lib/python3.6/site-packages/pandas/core/frame.py in __init__(self, data, index, columns, dtype, copy)
  12. 385 if is_named_tuple(data[0]) and columns is None:
  13. 386 columns = data[0]._fields
  14. --> 387 arrays, columns = _to_arrays(data, columns, dtype=dtype)
  15. 388 columns = _ensure_index(columns)
  16. 389
  17.  
  18. /opt/conda/envs/fastai/lib/python3.6/site-packages/pandas/core/frame.py in _to_arrays(data, columns, coerce_float, dtype)
  19. 7439 return _list_of_series_to_arrays(data, columns,
  20. 7440 coerce_float=coerce_float,
  21. -> 7441 dtype=dtype)
  22. 7442 elif isinstance(data[0], Categorical):
  23. 7443 if columns is None:
  24.  
  25. /opt/conda/envs/fastai/lib/python3.6/site-packages/pandas/core/frame.py in _list_of_series_to_arrays(data, columns, coerce_float, dtype)
  26. 7531 indexer = indexer_cache[id(index)]
  27. 7532 else:
  28. -> 7533 indexer = indexer_cache[id(index)] = index.get_indexer(columns)
  29. 7534
  30. 7535 values = com._values_from_object(s)
  31.  
  32. AttributeError: 'builtin_function_or_method' object has no attribute 'get_indexer'
  33.  
  34.  
  35. Dataframe is:
  36.  
  37. Page 2015-07-01 2015-07-02 2015-07-03 2015-07-04 2015-07-05 2015-07-06 2015-07-07 2015-07-08 2015-07-09 ... 2016-12-23 2016-12-24 2016-12-25 2016-12-26 2016-12-27 2016-12-28 2016-12-29 2016-12-30 2016-12-31 ds
  38. 0 2NE1_zh.wikipedia.org_all-access_spider 18 11 5 13 14 9 9 22 26 ... 63 15 26 14 20 22 19 18 20 0
  39. 1 2PM_zh.wikipedia.org_all-access_spider 11 14 15 18 11 13 22 11 10 ... 42 28 15 9 30 52 45 26 20 1
  40. 2 3C_zh.wikipedia.org_all-access_spider 1 0 1 1 0 4 0 3 4 ... 1 1 7 4 4 6 3 4 17 2
  41. 3 4minute_zh.wikipedia.org_all-access_spider 35 13 10 94 4 26 14 9 11 ... 10 26 27 16 11 17 19 10 11 3
  42. 4 52_Hz_I_Love_You_zh.wikipedia.org_all-access_s... 0 0 0 0 0 0 0 0 0 ... 9 25 13 3 11 27 13 36 10 4
  43. 5 rows × 552 columns
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement