Pandas Writing Dataframe Columns to csv

前端 未结 1 422
[愿得一人]
[愿得一人] 2020-12-23 20:10

I\'m writing a script to reduce a large .xlsx file with headers into a csv, and then write a new csv file with only the required columns based on header name.



        
相关标签:
1条回答
  • 2020-12-23 21:05

    The way to select specific columns is this -

    header = ["InviteTime (Oracle)", "Orig Number", "Orig IP Address", "Dest Number"]
    df.to_csv('output.csv', columns = header)
    
    0 讨论(0)
提交回复
热议问题