I have a pandas DF with datetime index: this select works fine
threeyrs=actdf['01/01/2010':'12/31/2012']
but I'd like to get something like this (to exclude 2010):
threeyrs=actdf['01/01/2009':'12/01/2009','01/01/2011':'12/01/2012']
which gives me "unhashable type" and this gives me a string
threeyrs=actdf['01/01/2009':'12/31/2009'],actdf['01/01/2011':'12/31/2012']
Is there a convenient way? dataFrame looks like
Units
date
2000-05-01 3041
2000-06-01 3079
2000-07-01 2455
2000-08-01 2671
2000-09-01 2220
threeyrs = pd.concat([actdf['01/01/2009':'12/01/2009'], actdf['01/01/2011':'12/01/2012']])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With