我有一个如下所示的CSV文件:
Date,Time,Mood,Tags,Medications,Notes
"Jul 25, 2018",9:41 PM,8,,,"",
"Jul 26, 2018",10:05 AM,4,,,"",
"Jul 26, 2018",12:00 PM,3,,,"",
"Jul 26, 2018",7:00 PM,8,,,"",
"Jul 27, 2018",12:01 PM,8,,,"",
我运行以下代码:
import pandas as pd
df = pd.read_csv("./data/MoodLog_2018_09_14.csv",
dtype={'Date': str, 'Time': str, 'Mood': str, 'Tags': str,
'Medications': str, 'Notes': str})
print(df['Time'].head(5))
并显示以下内容:
Jul 25, 2018 8
Jul 26, 2018 4
Jul 26, 2018 3
Jul 26, 2018 8
Jul 27, 2018 8
Name: Time, dtype: object
它包括Mood
列中的Time
列。
那是为什么?