Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
error in timestamp
#3
I agree that all timestamps are not the same. When the program runs the following code

# Convert timestamp column into data type into datetime
df['timestamp'] = pd.to_datetime(df['timestamp'])
things change. I just do not see how they change. It seems it is converting a scalar in timestamp to ...what?
That is the cause of this error but removing this statement will not fix the error. You just get another error; that error is different.

Now the statement

 Assign values to series
for i in tqdm(range(df.shape[0])):
    if (df["timestamp"][i].hour >= 4) and (df[timestamp][i].hour < 10):
        time_period[i]="Morning"  

Will fail when because timestamp is changed. But changed to what? If I knew the answer to the first question then I could make an educated guess.

Any help such as a hint appreciated.

Thanks in advance.

Respectfully,

LZ
Reply


Messages In This Thread
error in timestamp - by Led_Zeppelin - Jun-10-2022, 07:59 PM
RE: error in timestamp - by deanhystad - Jun-10-2022, 09:17 PM
RE: error in timestamp - by Led_Zeppelin - Jun-15-2022, 07:32 PM
RE: error in timestamp - by deanhystad - Jun-15-2022, 08:28 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  error in timestamp Led_Zeppelin 0 1,513 Jun-10-2022, 07:59 PM
Last Post: Led_Zeppelin
  Timestamp is undefined ErnestTBass 7 10,296 Feb-16-2019, 08:27 PM
Last Post: snippsat
  timestamp not updating bowen73 3 8,538 Aug-20-2017, 11:13 PM
Last Post: bowen73
  matplotlib timestamp zero_shubh0 2 7,813 Dec-02-2016, 02:12 PM
Last Post: zero_shubh0

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020