一. pd.read_csv()中的参数parse_dates:
parse_dates: 布尔值、由整数、名字、数列构成的数列、也可以为字典。(boolean or list of ints or names or list of lists or dict, default False)
意义:指定将某些列作为时间索引
- boolean. True -> 解析索引
- list of ints or names. e.g. If [1, 2, 3] -> 解析1,2,3列的值作为独立的日期列;
- list of lists. e.g. If [[1, 3]] -> 合并1,3列作为一个日期列使用
- dict, e.g. {‘foo’ : [1, 3]} -> 将1,3列合并,并给合并后的列起名为"foo"
data = pd.read_csv("data.csv", sep = "\s+")
data.head()
利用parse_dates将前三列合并为一列,指定