2.2 案例分析
假设我们现在有些自行车行驶数据,看看我们能Pandas分析出一些什么吧
题目代码:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
###STEP2###
def convert_data_to_timeseries(input_file, column, verbose=False):
# 导入数据
data = np.loadtxt(input_file, delimiter=',')
# 确定索引的开始与结束时间
start_date = str(int(data[0,0])) + '-' + str(int(data[0,1]))
end_date = str(int(data[-1,0] + 1)) + '-' + str(int(data[-1,1] % 12 + 1))
###问题一:完善函数###
###提示:通过pandas的date_range函数获取索引###
"""
在
这
里
补
充
代
码
"""