Reputation: 111
I am very stuck with this, obviously I have little experience, so every opinion is welcome:
df = pd.concat((pd.read_csv(f,delimiter = '|') for f in onlyfiles)
# I have to delete the column 'Unnamed: 0'
df = df.drop(['Unnamed: 0'])
df.head()
If somebody can tell something about this 'Unnamed: 0' column, I don't understand what's the use of this?
Thanks!
Upvotes: 0
Views: 2610
Reputation: 19947
If you want to drop the column inplace, there's another way to do it.
del(df['Unnamed: 0'])
Upvotes: 0
Reputation: 294258
'Unnamed: 0'
is a column name. You'll need to pass the axis=1
parameter to drop
df = df.drop(['Unnamed: 0'], axis=1)
Because the axis
parameter is the second parameter, that can be shortened to
df = df.drop(['Unnamed: 0'], 1)
Upvotes: 4