Home > OS >  DataFrame Pandas Python select data from date
DataFrame Pandas Python select data from date

Time:11-22

df1 = df1[df1['TIME STAMP'].between('2021-01-27 00:00:00', '2021-10-10 23:59:59')]

The above code is selecting a dataframe from two specific dates and it works fine.

I want to select a from date and to date (infinity/the last date of dataframe) or any option to select only from date.

CodePudding user response:

You can use comparison operators between timestamps:

import pandas as pd

df1 = df1[df1['TIME STAMP'] >= pd.Timestamp('2021-01-27 00:00:00')]
  • Related