请帮助,我需要删除“日期”索引列,否则“日期”将出现在第一列的操作
heat_ds = pd.DataFrame(columns=['PFE','GS','BA','NKE','V','AAPL','TSLA','NVDA','MRK','CVX','UNH'])
heat_ds['PFE'] = pfizer['Close']
heat_ds['GS'] = goldmans['Close']
heat_ds['BA'] = boeingc['Close']
heat_ds['NKE'] = nike['Close']
heat_ds['V'] = visa['Close']
heat_ds['AAPL'] = aaple['Close']
heat_ds['TSLA'] = tesla['Close']
heat_ds['NVDA'] = tesla['Close']
heat_ds['MRK'] = tesla['Close']
heat_ds['CVX'] = chevronc['Close']
heat_ds['UNH'] = unitedh['Close']
1条答案
按热度按时间gfttwv5a1#
首先,
date
代表索引。要删除它,首先重置索引,从 Dataframe 的索引中删除date
,使其成为普通列,然后删除该列。或在一行中