To read a CSV file in Python using Pandas when there are no column names provided, use the header
parameter as None
. The following code snippet demonstrates how to read a CSV file with no column names:
main.py67 chars4 lines
Setting header
to None
will tell Pandas to use default integer column names (0
, 1
, 2
, ...) for the DataFrame.
gistlibby LogSnag