import pandas as pd
import numpy as np
import datetime as dt
import shutil
data = pd.read_excel('\\\desktop\data.xls',
sheetname = '1', usecols = ['Date'] )
q_date = pd.to_datetime(data['Date'].iget(1)).strftime("%Y/%m/%d")
我收到如下错误:
AttributeError:'Series'
对象没有属性'iget'
答案 0 :(得分:2)
iget
已弃用
改为使用.iloc[i]
或.iat[i]
https://pandas.pydata.org/pandas-docs/version/0.19.1/generated/pandas.Series.iget.html
答案 1 :(得分:0)
q_date = pd.to_datetime(data['Date'].iloc(1)).strftime("%Y/%m/%d")
或
q_date = pd.to_datetime(data['Date'].iat(1)).strftime("%Y/%m/%d")
iget()
不久前已被弃用