如果含有中文或者英文长句子,里面很可能会有“,”,而CSV的逗号是分隔符(delimter,或Seperator)所以要加参数,把分隔符从逗号替换为‘\t’制表符
>>>pandas.read_csv('path',delimter='\t').head()
or
>>>file=pandas.read_csv('path',sep='\t')
>>>file.head()
from matplotlib import pyplot as plt
import numpy as np
import pandas as pd
hour=range(24)
viewers_hour = [30, 17, 34, 29, 19, 14, 3, 2, 4, 9, 5, 48, 62, 58, 40, 51, 69, 55, 76, 81, 102, 120, 71, 63]
plt.title('know nothing series')#title
plt.xlabel('Hour')#xlabel
plt.ylabel('Viewers')#ylabel
plt.plot(hour,viewers_hour)#x_data_source ,y_data_source
plt.legend(['legend1'])#图例
ax=plt.subplot()#在大的figure中可以建立多个axes
ax.set_facecolor('seashell')
ax.set_xticks(hour)#刻度
ax.set_yticks([0,20,40,60,80,100,120])#刻度
y_upper=[i+(i*0.05) for i in viewers