v05 update
This commit is contained in:
parent
cec150f345
commit
298a4cb64a
|
@ -30,6 +30,7 @@ TimesNesRoman = font_manager.FontProperties(
|
||||||
def createLineChart(frames_y, date_list, time_list):
|
def createLineChart(frames_y, date_list, time_list):
|
||||||
chart_startTime = time.time() # 作图开始时间
|
chart_startTime = time.time() # 作图开始时间
|
||||||
|
|
||||||
|
# -----------作图开始-----------
|
||||||
# 画布尺寸
|
# 画布尺寸
|
||||||
plt.figure(figsize=(8, 4))
|
plt.figure(figsize=(8, 4))
|
||||||
# 线型
|
# 线型
|
||||||
|
@ -63,6 +64,8 @@ def createLineChart(frames_y, date_list, time_list):
|
||||||
# 保存图像
|
# 保存图像
|
||||||
plt.savefig(f'{ROOT_PATH}/date_frames_chart.png',
|
plt.savefig(f'{ROOT_PATH}/date_frames_chart.png',
|
||||||
dpi=300, bbox_inches='tight')
|
dpi=300, bbox_inches='tight')
|
||||||
|
|
||||||
|
# -----------作图结束-----------
|
||||||
chart_endTime = time.time() # 作图开始时间
|
chart_endTime = time.time() # 作图开始时间
|
||||||
chart_totalTime = chart_endTime - chart_startTime # 作图用时
|
chart_totalTime = chart_endTime - chart_startTime # 作图用时
|
||||||
print(
|
print(
|
||||||
|
@ -86,21 +89,46 @@ def csv2list(csv_path):
|
||||||
return d_list, t_list, frames_list
|
return d_list, t_list, frames_list
|
||||||
|
|
||||||
|
|
||||||
def aaa(date_list, time_list):
|
def index_date(date_list):
|
||||||
tmp_date = date_list[0] # 首个日期
|
tmp_date = date_list[0] # 首个日期
|
||||||
i_d_list = []
|
i_d_list = []
|
||||||
i_d_list.append([0, tmp_date])
|
# i_d_list.append([0, tmp_date])
|
||||||
|
i_d_list.append(0)
|
||||||
|
|
||||||
for i in range(len(date_list)):
|
for i in range(len(date_list)):
|
||||||
if (tmp_date != date_list[i]):
|
if (tmp_date != date_list[i]):
|
||||||
i_d_list.append([i, date_list[i]])
|
# i_d_list.append([i, date_list[i]])
|
||||||
|
i_d_list.append(i)
|
||||||
tmp_date = date_list[i]
|
tmp_date = date_list[i]
|
||||||
print(i_d_list)
|
print(i_d_list)
|
||||||
|
return i_d_list
|
||||||
|
|
||||||
|
# def date_time_frames_split(csv_path="../date_time_frames.csv"):
|
||||||
|
# f = open(csv_path, 'r') # 读取csv
|
||||||
|
# f_list = csv.reader(f) # 转成csv
|
||||||
|
# for item in f_list:
|
||||||
|
# print(item)
|
||||||
|
|
||||||
|
|
||||||
|
# d_list = [] # 日期列表
|
||||||
|
# t_list = [] # 时间列表
|
||||||
|
# frames_list = [] # 时间列表
|
||||||
|
|
||||||
|
# tmp_date = date_list[0] # 首个日期
|
||||||
|
# i_d_list = []
|
||||||
|
# i_d_list.append([0, tmp_date])
|
||||||
|
|
||||||
|
# for i in range(len(date_list)):
|
||||||
|
# if (tmp_date != date_list[i]):
|
||||||
|
# i_d_list.append([i, date_list[i]])
|
||||||
|
# tmp_date = date_list[i]
|
||||||
|
# print(i_d_list)
|
||||||
|
# return i_d_list
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
date_list, time_list, frames_list = csv2list("../date_time_frames.csv")
|
date_list, time_list, frames_list = csv2list("../date_time_frames.csv")
|
||||||
# print(date_list)
|
|
||||||
# print(time_list)
|
|
||||||
# print(frames_list)
|
|
||||||
|
|
||||||
aaa(date_list, time_list)
|
index_date(date_list)
|
||||||
|
# createLineChart(frames_list, date_list, time_list) # 创建日期-帧数图
|
||||||
|
|
||||||
|
# date_time_frames_split()
|
||||||
|
|
Loading…
Reference in New Issue