Getting min and max Dates from a pandas dataframe
'Date' is your index so you want to do,
print (df.index.min())
print (df.index.max())
2014-03-13 00:00:00
2014-03-31 00:00:00
min(df['some_property'])
max(df['some_property'])
The built-in functions work well with Pandas Dataframes.
Use agg
to determine the minimum and maximum value in one line:
In [5]: df['Date'].agg(['min', 'max'])
Out[5]:
min 2014-03-13
max 2014-03-31
If your desired column is in the index, you have to reset the index first:
df.reset_index()['Date'].agg(['min', 'max'])