需求场景:
想从dataframe里的['Direction']列筛选出值为‘sell’的相关数据,随后做条件测试。
方法使用:
一、使用df.index ==' ',的筛选方法
Options.Direction== 'Sell' 错误,出现值无法精确确认其类型的错误。思考点:dataframe和datafrae的value的关系。
Options.Direction[0]== 'Sell'解决问题
查看其他人的方法
二、Options['Direction'].iloc[0]== 'Sell'也可解决问题