#Create the independent data set
for day in df_days:
days.append([int(day.split('-')[4])])
#Create the dependent data set (adj close prices)
for adj_close_price in df_adj_close:
adj_close_prices.append( float(adj_close_price))
我收到错误消息#"AttributeError:'Timestamp‘对象没有’split‘属性“
有没有人能帮帮忙?
发布于 2020-12-25 15:07:19
我相信你需要一个string对象来执行slip操作。我相信你使用的是时间戳("datetime“类型)对象。如果使用"datetime“,请对对象使用字符串格式或直接对时间戳对象使用"day = datetimeobj.strftime("%d")”。如果您使用的是时间戳,请先将其转换为"datetime","datetimeobj=datetime.fromtimestamp(timestamp)“
https://stackoverflow.com/questions/65445889
复制相似问题