zoukankan      html  css  js  c++  java
  • python.pandas read and write CSV file

    #read and write csv of pandas
    import pandas as pd

    goog =pd.read_csv(r'C:pythondemoLiaoXueFengdata est_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:pythondemoLiaoXueFengdatagoog2.csv',encoding='GBK',mode='a')
  • 相关阅读:
    场景调研
    12.8
    12.7
    12.6
    12.5
    12.4
    12.3
    重启oracle数据库的操作方法
    oracle创建dblink方法
    SQL*Loader 详解
  • 原文地址:https://www.cnblogs.com/csj007523/p/7234866.html
Copyright © 2011-2022 走看看