讀取鍵盤輸入的資料來搜索excel表格里的行資料,明明時存在的卻顯示empty dataframe.
import pandas as pd
import numpy as np
df = pd.read_excel('閥片.xlsx')
#df = pd.DataFrame(pd.read_excel('閥片.xlsx',header=1))
df.dropna(axis=1,how='all',inplace = True)
#df = df.astype(str)
value1 = int(input(":"))
data = df.loc[df['id'].str.contains('value1')]
print("獲取的資料:\n{0}".format(data))
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/126299.html
標籤:其他開發語言
