While creating some plots with matplotlib I found a strange behavior of pandas, when I select only 1 column it returns 2.
import pandas as pd
import io
data = io.StringIO("""time_0,1,time_1,2,time_2,0,time_3,3
-0.002,-0.1225,-0.002,-0.0904,-0.002,0.0331,-0.002,0.,
0.0,-0.1225,0.,-0.0904,0.,0.0331,0.,0.,
0.002,-0.1224,0.002,-0.0904,0.002,0.0331,0.002,0.,
0.004,-0.1225,0.004,-0.0904,0.004,0.0331,0.004,0.,""")
df = pd.read_csv(data)
print(df["time_0"])
Output:
-0.002 -0.1225
0.000 -0.1225
0.002 -0.1224
0.004 -0.1225
Name: time_0, dtype: float64
It shows values from both column "time_0" and "1", but only "time_0" was selected. Is this a bug or a feature?