Python的excel处理操作

401次阅读
没有评论
Python的excel处理操作

Python的excel处理操作

创建excel在桌面

import  pandas as pd

df =pd.DataFrame()
df.to_excel('C:/Users/Administrator/Desktop/output.xlsx')
print("done!")

注意要建立pip install openpyxl 包

读取excel

board=pd.read_excel('C:/Users/Administrator/Desktop/data.xlsx',
engine='openpyxl')
print(board.shape)
print(board)

画图

import matplotlib.pyplot as plt

board.plot.line(x='省份',y='死亡')
plt.show()

花式绘图

board.plot.bar(x='省份',y=['死亡','现有确诊'],color=['orange','red'])
plt.show()

以上就是Python的excel几种常规处理操作,快点尝试看看吧~

神龙|纯净稳定代理IP免费测试>>>>>>>>天启|企业级代理IP免费测试>>>>>>>>IPIPGO|全球住宅代理IP免费测试

相关文章:

版权声明:wuyou2021-06-29发表,共计458字。
新手QQ群:570568346,欢迎进群讨论 Python51学习