我想做的是将搜索功能添加到数据框中。我希望能够键入文件名并保存发现为真的行。这样当我使用iloc时它就会返回文件名和";modified_data"在一起。
import pandas as pd
#....
df = pd.DataFrame(data, columns=['filename', 'modified_date'])
if df['filename'].str.contains('AAROW PDM Report') == TRUE:
RowValue = #I want it to be equal to the row that was found true
print(df.iloc[[RowValue]])
尝试:
RowValue = df['filename'].str.contains('AAROW PDM Report').idxmax()