1. 带有时间的DataFrame绘图
python code for pandas.Dataframe column data visulize with a timestamp format time index/column. (orginal data is csv seprated with “,”)
import matplotlib.pyplot as plt
import pandas as pd
df = pd.read_csv("filename.csv", sep=",")
# this is the column name of the time colume
time_column = "Datatime"
# convert the time column to standard time type
ts = pd.to_datatime(df[time_column])
del df[time_column])
# data need to be visualized
tem = df["temperature"]
plt.plot(ts, tem)
plt.title("temperature")
plt.show()
2. excel的单元格设置显示标准时间
set the unit cell display format to GENERAL with value of yyyy/m/d h:mm:ss.000
, then time display will not be shrinked.