import pandas as pd import numpy as np df = pd.read_csv("result.csv") # csv # df = pd.read_excel("sample.xlsx") # excel df.to_excel("sample.xlsx", encoding="gbk", index=False) # write data to excel print(df.head(10)) # include row title, read 0-3 row data, sum is 5 row, read 0-1 column data, sum is 2 column column = df.ix[:3, :2] column.to_excel("sample.xlsx", encoding="gbk", index=False)
原文地址:https://www.cnblogs.com/lzhc/p/9196794.html
时间: 2024-10-01 09:26:19