I am trying to delete the column of a pandas dataframe and I get the following error: ValueError: labels [' 5'] not contained in axis
. However my print df.columns
returnsInt64Index([0, 1, 2, 3, 4, 5, 6], dtype='int64')
. See bellow the code as well:
df = pd.read_csv(StringIO(data),skiprows=186,sep=";",header=None)
#df.drop(' 5', inplace=True)
b= df.columns.tolist()
print df.columns