I am writing a code to read and extract parameters from each row of a CSV file.
From each row, I get a list of parameter values arranged by datestamps and values. An example csv file is as below:
Row1: 'Fanspeed','Value=32','Datetime=05-01-2015','Fanspeed','Value=32','Datetime=05-02-2015'
Row2: 'Fanspeed','Value=32','Datetime=05-03-2015','Fanspeed','Value=32','Datetime=05-04-2015'
If I use the Pandas read_csv to read in the file and then print the output, it only prints the first row. However, when I use the csv.reader function, I get the correct output. My program looks like this:
csv_f = pd.read_csv('test.csv')
for row in csv_f:
csv_f = pd.read_csv('test.csv')
print csv_f
I get only the following output:
'Fanspeed','Value=32','Datetime=05-01-2015','Fanspeed','Value=32','Datetime=05-02-2015'
However, on running the same program with the csv.reader function as below:
f = open('test.csv')
csv_f = csv.reader(f)
for row in csv_f:
csv_f = pd.read_csv('test.csv')
print csv_f
I get the correct output. Could someone help me?