self_example/TensorFlow_eaxmple/data_deal/平行化展示趋势图.py

19 lines
670 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from pylab import *
import pandas as pd
import matplotlib.pyplot as plot
datafile = pd.read_csv('E:\TensorFlow_eaxmple\dataset\某地降雨量.csv')
print(datafile)
'''计算求和平均等数据属性'''
summary=datafile.describe()
minRing=-1
maxRing=99
nrows=11
for i in range(nrows):
'''每行数据用不同的颜色的线展示每行数据即每年在十二月这十二个维度的数据该方法即可平行化展示每年的这12个维度'''
dataRow=datafile.iloc[i,1:13]
labelColor=(datafile.iloc[i,12]-minRing)/(maxRing-minRing)
dataRow.plot(color=plot.cm.RdYlBu(labelColor),alpha=0.5)
plot.xlabel("Attribute")
plot.ylabel("Score")
show()