我有一個系列,如如下:大熊貓重新編制了一系列
indic={'indicator_name': {0: '10-Year Note Auction',
1: '10-Year TIPS Auction',
2: '2-Year Note Auction',
3: '3-Month Bill Auction',
4: '3-Year Note Auction'}}
ind_serie=pd.Series(indic)
我想重新索引它,以便值也是指數(即:0: '10-Year Note Auction'
成爲'10-Year Note Auction': '10-Year Note Auction'
等)
如果ind_serie
是一個數據幀我會用:
ind_serie.set_index('indicator_name', drop=False, inplace=True)
重新索引功能也似乎沒有工作。
ind_serie.reindex(index='indicator_name')
但是,在系列的情況下使用正確的語法是什麼?
我想你的意思是系列的方式。 – 2016-12-29 02:57:27
@fuzzyhedge:是... –