AttributeError:“系列”对象没有属性“ iget”

时间:2019-11-05 03:27:05

标签: python

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'

2 个答案:

答案 0 :(得分:2)

答案 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()不久前已被弃用