Bottom Page

Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Error: Slicing a single date from Pandas
#1
Dear Experts,

I am using Python 3.6 and Pandas. My data looks like this:

SPY
2014-10-31 0.024425
2014-11-28 0.026894
2014-12-31 -0.002519
2015-01-30 -0.030020
2015-02-27 0.057474
2015-03-31 -0.015816
2015-04-30 0.009595

I have tried the following codes to retrieve the date of 2015/01/30. All work except the last one.

logR[pd.datetime(2015, 1, 30):pd.datetime(2015, 1, 30):] ok
logR['2015/01/30':'2015/01/30'] ok
logR.loc['2015/01/30'] ok
logR.ix['2015/01/30'] ok but deprecated warning
logR['2015/01/30'] KeyError: '01/30/2015'

Whats wrong??

Thank you for your help
L
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Trying to Pass date to pandas search from input prompt curranjohn46 1 125 Oct-10-2019, 10:01 AM
Last Post: curranjohn46
  Need help passing date to pandas query curranjohn46 1 152 Oct-10-2019, 09:59 AM
Last Post: curranjohn46
  pandas DataReader error on all data sources glidecode 5 6,426 Sep-25-2019, 02:10 PM
Last Post: perfringo
  Key error when using adodbapi, azure and pandas mazamus 2 580 Sep-11-2019, 06:54 AM
Last Post: TomKom
  Pandas converting date to epoch randor 2 323 Jul-16-2019, 02:41 AM
Last Post: scidam
  replace nan values by mean group by date.year, date.month wissam1974 4 494 Jul-06-2019, 02:00 AM
Last Post: wissam1974
  pandas install error loren41 5 609 May-20-2019, 06:42 PM
Last Post: loren41
  Pandas and Date: problem with operator.How to resolve frame 6 1,180 May-13-2019, 05:50 PM
Last Post: frame
  Working with date indexes (pandas) dervast 0 371 Apr-05-2019, 01:29 PM
Last Post: dervast
  utf-8 error with pandas read_csv logues 0 995 Oct-23-2018, 05:25 PM
Last Post: logues

Forum Jump:


Users browsing this thread: 1 Guest(s)