0

datetime datetime64[ns]-----earlier it was in object and later i converted it into datetime format

TypeError: float() argument must be a string or a number, not 'Timestamp'

sshashank124
  • 31,495
  • 9
  • 67
  • 76
  • I guess there is no such structure. You should use something like [Label Encoder](https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.LabelEncoder.html) etc. – E. Zeytinci Jan 12 '20 at 10:02
  • This can be useful: https://stackoverflow.com/questions/40217369/python-linear-regression-predict-by-date – E. Zeytinci Jan 12 '20 at 13:06
  • `Timestamp` is just int64 underneath. You can convert it to Unix time with `df['date'].astype(np.int64)`. The returned numbers are in nanoseconds since Jan 1, 1970. – Code Different Jan 12 '20 at 14:39

0 Answers0