Setting freq of pandas DatetimeIndex after DataFrame creation

后端 未结 3 532
猫巷女王i
猫巷女王i 2021-02-12 12:03

Im using pandas datareader to get stock data.

import pandas as pd
import pandas_datareader.data as web
ABB = web.DataReader(name=\'ABB.ST\', 
                           


        
3条回答
  •  Happy的楠姐
    2021-02-12 12:36

    ABB is pandas DataFrame, whose index type is DatetimeIndex.

    DatetimeIndex has freq attribute which can be set as below

    ABB.index.freq = 'd'
    

    Check out the change

    ABB.index
    

提交回复
热议问题