0

The type is of course pandas.core.frame.DataFrame

The data is like this

res["created_at"]
0 2018-11-15 02:14:38
1 2018-11-15 02:14:20
2 2018-11-15 02:13:34
3 2018-11-15 01:53:18
...

I need to split "create_at" into "date" and "time" but when I try to do it based on this question How to split a column into two columns?:

res['date'], res['time'] = res['created_at'].str.split(' ', 1).str**

or

res['created_at'].str.split(' ', 1, expand=True)

I get the following error in both cases:

AttributeError: Can only use .str accessor with string values, which use np.object_ dtype in pandas
Ricardo Prieto
  • 357
  • 1
  • 3
  • 12

0 Answers0