Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to load Only column names from csv file (Pandas)?

I have a large csv file and don't want to load it fully into my memory, I need to get only column names from this csv file. How to load it clearly?

like image 697
Ivan Shelonik Avatar asked May 22 '17 09:05

Ivan Shelonik


1 Answers

try this:

pd.read_csv(file_name, nrows=1).columns.tolist()
like image 65
MaxU - stop WAR against UA Avatar answered Sep 24 '22 15:09

MaxU - stop WAR against UA