I have a dataframe with some (hundreds of) million of rows. And I want to convert datetime to timestamp effectively. How can I do it?
My sample df:
df
There's also another method to do this using the "hidden" attribute of DatetimeIndex called asi8, which creates an integer timestamp.
DatetimeIndex
asi8
pd.DatetimeIndex(df.datetime).asi8
Wes McKinney suggested it in this tangentially related stackoverflow question linked here