Reading rows from a CSV file in Python

前端 未结 10 2431
慢半拍i
慢半拍i 2020-11-30 23:58

I have a CSV file, here is a sample of what it looks like:

Year:  Dec: Jan:
1      50   60
2      25   50
3      30   30
4      40   20
5      10   10
         


        
10条回答
  •  长情又很酷
    2020-12-01 00:50

    One can do it using pandas library.

    Example:

    import numpy as np
    import pandas as pd
    
    file = r"C:\Users\unknown\Documents\Example.csv"
    df1 = pd.read_csv(file)
    df1.head()
    

提交回复
热议问题