Type error in Linear Regression

linear_regression
pandas
machine_learning
python

#1

Hello,

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.


#2

@ASHISH_17

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.


#3

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.
best-day-of-week-engage-with-followers1

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


#4

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