Type error in Linear Regression




I am getting a TypeError: float() argument must be a string or a number, not ‘Timestamp’.

Can’t we use date-time entries?
Though I have grouped them on the basis of hourly, weekly and monthly.

In the dataset, pick-up and drop-off date-time along with the latitude and longitude coordinates are given.



No, you can’t take timestamp feature directly in the model.
It is better to extract out features from the data-time entries and then use them effectively according to your problem.


To add to @shubham.jain’s answer, a timestamp in its raw form doesn’t convey much useful information.

We usually look for patterns by extracting features from time stamps. For example, on extracting days of week you might notice that some activity is happening more on weekends than weekdays.

Another example would be for example you extracted time of day from a timestamp you might notice some pattern based on time of day like below


I have grouped them on hourly, weekly and monthly basis.