I have a dataframe that looks like this :
0 1 2 ... 147 148 149
Columns 0 190.2 190.5 189.9 ... 146.7 146.4 146.1
Values 0 -49.3892 -47.0297 -39.528 ... -30.7926 -30.7561 -30.719
Columns 1 190.2 190.5 189.9 ... 146.7 146.4 146.1
Values 1 -49.3892 -47.0297 -39.528 ... -30.7926 -30.7561 -30.719
Columns 2 190.2 190.5 189.9 ... 146.7 146.4 146.1
I want to create a curve for every pair Columns #
and Value #
. The dataframe has 3478 rows so 1738 pairs of data.
I have tried a for loop
that looks like:
import matplotlib.pyplot as plt
nline2 = len(df2.index)
for i in range (0,(nline-2),2)
x_data = df2.values[[i]]
y_data = df2.values[[(i+1)]]
plt.plot(x_data,y_data)
But i get an error message : TypeError: unhashable type: 'numpy.ndarray'
Note that i am trying to plot only to see what i get, the ultimate goal of this to calulate the area under the curve for each pair and add it for all pairs. Hense the for loop
.
UPDATE
I think found the source of the problem, the rows calles Columns #
are used as headers and not scalar values. I tried df2.iat[index,columns]
but without success.