0

I am trying to load a csv file as a dataframe

import pandas as pd
import numpy as np

# loading csv files

map1 = pd.read_csv('data001.csv')

print(map1)

However, the dataframe's column names are provided from the first's row *.csv file values. Any ideas how can I obtain a dataframe with column names that are sequentially numbered instead?

Thanks!

JRR
  • 1
  • 2

1 Answers1

2

This will work. It won't read in the header, giving you numbered columns and then it skips the header.

import pandas as pd    
map1 = pd.read_csv('data001.csv', header=None, skiprows=1)
ALollz
  • 57,915
  • 7
  • 66
  • 89
  • 1
    I think there is a comma missing before header=None... but otherwise, worked great! – JRR Apr 20 '18 at 14:42
  • You're right. I messed that up when I changed it from my csv's name to yours. I fixed it. – ALollz Apr 20 '18 at 14:43