【发布时间】:2020-07-08 21:11:25
【问题描述】:
我有以下日期列表:
date_list
DatetimeIndex(['2015-07-10', '2015-07-13', '2015-07-14', '2015-07-15',
'2015-07-16', '2015-07-17', '2015-08-20', '2015-09-21',
'2015-09-22', '2015-09-23']
要访问这些日期的 pandas 中的行的值,我这样做了:
df['Close'].loc[dates_list]
这会产生以下错误:
KeyError: 'Passing list-likes to .loc or [] with any missing labels is no longer supported
如何获取这些DateTtimeindex 的行值
【问题讨论】:
标签: python python-3.x pandas datetime