header=None not working as intended in Pandas

When loading a CSV first line is being turned into the header, even when using the command header=None

1st 6 Lines of CSV

"L","65496","56","17","2","1","2","2","2","1","2","2","2","2","2","202210024616","10/07/2022","11/04/2022","6401 30TH AVE S","","Seattle","98108","","6401 30TH AVE S","","Seattle","WA","98108","","7233841","206","","","24","11","3","0.00","1","","2","2","2","2","2","1","2","2","2","2","2","2","2","1805","911.00","0","0.00","2","2","584","0","44","200001263785","584","","","","584","","","","","","","","","","","","","","","","","","","","","","","","","","","","0","11/06/2022","0","EAP","","","","","","","","21-3260A","","","","","","","","","","","","","","","","","","","","","","","","","","",""
"L","65082","56","17","1","1","2","2","2","1","2","2","2","2","2","202210024429","10/04/2022","10/13/2022","6317 1st ave ne","","Seattle","98115","","6317 1st ave ne","","Seattle","WA","98115","","3563485","206","","","8","11","1","0.00","1","","2","2","2","2","2","1","2","2","2","2","2","2","2","1031","542.00","0","0.00","2","2","391","0","44","220012687236","391","","","","391","","","","","","","","","","","","","","","","","","","","","","","","","","","","0.00","11/06/2022","0","EAP","","","","","","","","21-3260A","","","","","","","","","","","","","","","","","","","","","","","","","","",""
"L","65151","56","17","1","1","2","2","2","1","2","2","2","2","2","202210024435","10/04/2022","10/20/2022","1215 N 45th St APT 425","","Seattle","98103","","1215 N 45th St APT 425","","Seattle","WA","98103","","4126320","206","","","6","11","3","70.00","3","","1","2","2","1","2","2","2","2","2","2","2","2","2","417","780.00","0","0.00","1","2","394","0","57","1309905172","394","","","","394","","","","","","","","","","","","","","","","","","","","","","","","","","","","0.00","11/06/2022","0","EAP","","","","","","","","21-3260A","","","","","","","","","","","","","","","","","","","","","","","","","","",""
"L","66363","56","17","1","1","2","2","2","1","2","2","2","2","2","202211026173","11/09/2022","12/07/2022","12036 3rd Ave NW","","Seattle","98177","","12036 3rd Ave NW","","Seattle","WA","98177","","2980334","206","","","13","11","1","1562.00","1","","2","2","2","2","2","2","2","2","2","2","2","2","2","0","1212.00","0","0.00","2","2","1000","0","44","200023063106","1000","","","","1000","","","","","","","","","","","","","","","","","","","","","","","","","","","","0.00","12/28/2022","0","EAP","","","","","","","","21-3260A","","","","","","","","","","","","","","","","","","","","","","","","","","",""
"L","65918","56","17","1","1","2","2","2","1","2","2","2","2","2","202211026510","11/16/2022","11/17/2022","955 10th Ave E","","Seattle","98102","","955 10th Ave E","","Seattle","WA","98102","","3545595","206","","","0","11","3","0.00","1","","2","2","2","2","2","2","2","2","2","2","2","2","2","0","2038.00","0","0.00","2","2","1000","0","44","220008470498","510","57","1541910000","490.00","1000","","","","","","","","","","","","","","","","","","","","","","","","","","","","0.00","11/30/2022","0","EAP","","","","","","","","21-3260A","21-3260A","","","","","","","","","","","","","","","","","","","","","","","","","",""
"L","65252","56","17","1","1","2","2","2","1","2","2","2","2","2","202210024484","10/05/2022","10/25/2022","348 19th Ave","","Seattle","98122","","348 19th Ave","","Seattle","WA","98122","","4500209","206","","","17","11","1","1.00","1","","1","2","2","2","2","1","2","2","1","2","2","2","2","1239","131.00","0","130.88","2","2","200","0","57","3234140000","102","44","200012073868","98.00","200","","","","","","","","","","","","","","","","","","","","","","","","","","","","0.00","11/06/2022","0","EAP","","","","","","","","21-3260A","21-3260A","","","","","","","","","","","","","","","","","","","","","","","","","",""

I typed the command

df_24 = pd.read_csv(r'Uploads/HHD_Formatted_20230224.csv', header=None)

and got

   L  65496  56  17  2  1  2.1  2.2  2.3  1.1  2.4  2.5  2.6  2.7  2.8  \
0  L  65082  56  17  1  1    2    2    2    1    2    2    2    2    2   
1  L  65151  56  17  1  1    2    2    2    1    2    2    2    2    2   
2  L  66363  56  17  1  1    2    2    2    1    2    2    2    2    2   
3  L  65918  56  17  1  1    2    2    2    1    2    2    2    2    2   
4  L  65252  56  17  1  1    2    2    2    1    2    2    2    2    2   

---Solved: I was using

head(df)

to view the csv, instead of using

display(df)

Which shows the dataset with the correct index

    0   1   2   3   4   5   6   7   8   9   ... 123 124 125 126 127 128 129 130 131 132
0   L   65496   56  17  2   1   2   2   2   1   ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
1   L   65082   56  17  1   1   2   2   2   1   ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
2   L   65151   56  17  1   1   2   2   2   1   ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
3   L   66363   56  17  1   1   2   2   2   1   ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
4   L   65918   56  17  1   1   2   2   2   1   ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
2209    L   68217   56  17  1   1   2   2   2   1   ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
2210    L   68222   56  17  2   1   2   2   2   1   ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
2211    L   68165   56  17  1   1   2   2   2   1   ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
2212    L   68268   56  17  1   1   2   2   2   1   ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
2213    L   68254   56  17  1   1   1   2   2   1   ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN


Comments

Popular posts from this blog

Today Walkin 14th-Sept

Hibernate Search - Elasticsearch with JSON manipulation

Spring Elasticsearch Operations