Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- temp = [dftt['ds'], dftt.columns[2]]
- df_temp = pd.DataFrame(data = temp)
- Error is:
- ---------------------------------------------------------------------------
- AttributeError Traceback (most recent call last)
- <ipython-input-21-9d324ce0f7e1> in <module>()
- 1 temp = [dftt['ds'], dftt.columns[2]]
- ----> 2 df_temp = pd.DataFrame(data = temp)
- /opt/conda/envs/fastai/lib/python3.6/site-packages/pandas/core/frame.py in __init__(self, data, index, columns, dtype, copy)
- 385 if is_named_tuple(data[0]) and columns is None:
- 386 columns = data[0]._fields
- --> 387 arrays, columns = _to_arrays(data, columns, dtype=dtype)
- 388 columns = _ensure_index(columns)
- 389
- /opt/conda/envs/fastai/lib/python3.6/site-packages/pandas/core/frame.py in _to_arrays(data, columns, coerce_float, dtype)
- 7439 return _list_of_series_to_arrays(data, columns,
- 7440 coerce_float=coerce_float,
- -> 7441 dtype=dtype)
- 7442 elif isinstance(data[0], Categorical):
- 7443 if columns is None:
- /opt/conda/envs/fastai/lib/python3.6/site-packages/pandas/core/frame.py in _list_of_series_to_arrays(data, columns, coerce_float, dtype)
- 7531 indexer = indexer_cache[id(index)]
- 7532 else:
- -> 7533 indexer = indexer_cache[id(index)] = index.get_indexer(columns)
- 7534
- 7535 values = com._values_from_object(s)
- AttributeError: 'builtin_function_or_method' object has no attribute 'get_indexer'
- Dataframe is:
- 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
- 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
- 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
- 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
- 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
- 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
- 5 rows × 552 columns
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement