我在数据框中丢失了一些日期,我试图用前一个日期来填充它们。所以我想第一部分是检查是否holdings_df['date']在d. 希望你能帮助我,因为我被困住了。
这是我的功能
在:
def get_holdings_df_date(d):
if (d in holdings_df['Date'].values):
# return holdings_df.loc[holdings_df['Date'] == d]
print('true')
print(get_holdings_df_date('2020-01-02'))
出去:
FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison
if (d in holdings_df['Date'].values):
None
Traceback (most recent call last):
File "calculatingnav.py", line 130, in <module>
system.exit()
拉丁的传说
相关分类