You can read only header of CSV file in Python using Pandas with the following code. I highly recommend you This book to learn Python.
Read Header of CSV File
# Import the Pandas library as pd import pandas as pd # Read the CSV file df = pd.read_csv("house_price.csv") # Display the Header of CSV print(df.columns)
Index(['Area', 'Rooms', 'House_Age', 'Price'], dtype='object')