문제

I have an uneven timestamped data that I would like to process in Pandas. The timestamps are in milliseconds starting at 0, So the data looks like

Timestamp        Property
0                   1
1                   2           
2                   3
4                   4
10                  4
19                  7

I have a very basic question, I can create a pd.Series object with index as the Timestamp. But how does Pandas know that my timestamps are in millis or for that matter in secs or hours?

도움이 되었습니까?

해결책

Pandas assumes timestamps are in nanos, if you want to convert a column in millis, use df['col'] = df['col'].astype('datetime64[ms]'). Note that the final column will be in nanos.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top