#read and write csv of pandas
import pandas as pd goog =pd.read_csv(r'C:\python\demo\LiaoXueFeng\data\test_vrt.csv',index_col=0)
goog=goog.reindex(pd.to_datetime(goog.index))
print(goog.head())
print(goog.tail()) data2 = [{'july': 9999, 'han': 5000, 'zewei': 1000}, {'july': 9999, 'han': 5000, 'zewei': 1000},
{'july': 9999, 'han': 5000, 'zewe2i': 1000}]
df3 = pd.DataFrame(data2)
df3.to_csv(r'C:\python\demo\LiaoXueFeng\data\goog2.csv',encoding='GBK',mode='a')
相关文章
- 02-05处理 read_csv 报错 OSError:Initializing from file failed
- 02-05python.pandas read and write CSV file
- 02-05C write and read file via FILE and open method in a+ or r mode
- 02-05write content to file via ofstream and read from file via ifstream
- 02-05pandas.read_csv() 报错 OSError: Initializing from file failed
- 02-05python 读取文件read.csv报错 OSError: Initializing from file failed
- 02-05Read / Write Excel file in Java using Apache POI
- 02-05C++ write and read file via fstream in ios::out,ios::in,ios::app mode