import csv as csv
import pandas as pd
csv_file_object = csv.reader(open("./facesAgeGenderData.csv", 'r'))
col_names = ['Timestamp', 'TotalFaces', 'FaceNumber', 'X', 'Y', 'Z', 'W', 'Age', 'Gender']
tempdf = pd.DataFrame(columns = col_names)
for row in csv_file_object:
tempdf.loc[len(tempdf)] = [row[0], row[1], row[2], row[3], row[4], row[5], row[6], row[7], row[8]]
print(tempdf.columns)
df = tempdf[(tempdf['FaceNumber'] == 0)]
print(df)
我想要tempdf为0
的tempdf的df数据帧,但得到空数据帧。