pandas 使用學習

  1. #讀文件
    data = pd.read_csv('data.csv')
    df = pd.read_csv(filename,encoding='utf-8')
    #寫文件
    df2.to_csv("shundeformat.csv",index=False,columns=['idcard_hash','imei_hash','phone_hash','qq_hash','detail_hash','date2'])
    
    #輸出一些信息
    print(df.shape)
        print(type(df))
        print(df.index)
        #print(df.head)
        print(df.columns,type(df.columns))
    
    #篩選:
     df2 = df[df['date2']!='']
    

    初步學習 之後會繼續總結

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章