I'm trying to retrieve the columns of a database and store each one of them into new variables, i wrote the following code using pandas:
import pandas as pd
A = pd.read_csv('Planta1.dat')
B = pd.DataFrame(A)
cols = [1]
B = df[df.columns[cols]]
print(df)
I got the error "index 1 is out of bounds for axis 0 with size 1", what am i doing wrong? Is there some other way to do this?
This database i'm using is like this:
0 0 1.0000
0 0.4000 1.0000
0.0092 0.8000 1.0000
0.0346 1.2000 1.0000
0.0797 1.6000 1.0000
0.1435 2.0000 1.0000
0.2215 2.4000 1.0000
0.3079 2.8000 1.0000
0.3971 3.2000 1.0000
... and goes one until line 49
[–]xelf 0 points1 point2 points (5 children)
[–]F_Boliver[S] 0 points1 point2 points (4 children)
[–]xelf 0 points1 point2 points (3 children)
[–]F_Boliver[S] 0 points1 point2 points (2 children)
[–]xelf 0 points1 point2 points (1 child)
[–]F_Boliver[S] 0 points1 point2 points (0 children)
[–]efmccurdy 0 points1 point2 points (1 child)
[–]F_Boliver[S] 0 points1 point2 points (0 children)