So I have a set of data loaded into python using pandas, it looks like :
V n I
0 -0.400 0.0 -6.611865e-05
1 -0.384 0.0 -6.340880e-05
2 -0.368 0.0 -6.063826e-05
3 -0.352 0.0 -5.789697e-05
4 -0.336 0.0 -5.512495e-05
... ... ... ...
4483 0.336 83.0 1.905807e-10
4484 0.352 83.0 2.146759e-10
4485 0.368 83.0 2.452133e-10
4486 0.384 83.0 2.511581e-10
4487 0.400 83.0 2.704376e-10
[4488 rows x 3 columns]
Each data set is marked by an n value, I want to use that n value to sepearate the I and V from each other so I can plot them on the same graph. The V range are pretty much identical in each set, while the I varies.
To plot all 84 data sets on one graph to do that I used:
#store data using pandas
data = pd.read_csv( f, sep = '\t', comment = '#', names = ['V','n','I'] )
#observe data format
print(data)
#plot data
fig, ax = plt.subplots()
data = data.pivot(index='V', columns='n', values='I')
data.plot()
plt.legend(loc='best')
plt.show()
But this gives me :
ValueError: Index contains duplicate entries, cannot reshape
I tried something similar for another data set with the same structure and that worked fine but not here. I kinda need those values even if they are identical, does anybody have ideas I can try? Thnx!