How to access pandas DataFrame datetime index using strings

后端 未结 3 937
轻奢々
轻奢々 2020-12-24 06:31

This is a very simple and practical question. I have the feeling that it must be a silly detail and that there should be similar questions. I wasn\'t able to find them tho.

3条回答
  •  别那么骄傲
    2020-12-24 07:21

    You can use the to_pydatetime function on your index so thus:

    y[y.index.to_pydatetime() == datetime.datetime(2008,1,1)]
    

提交回复
热议问题