I have multiple dataframes which I join based on a common column. The code looks like this:
df=reduce(lambda x,y:pd.merge(x,y,on='name'),[total,eliminated, actionable, bug])
Afterwards, I intend to rename the column name
. But name
is not anymore in the column list. When I print the df
, the name column shows but I don't know how to work with that merged column anymore, like renaming.
If I print type(df), df.columns, df
, it shows:
(pandas.core.frame.DataFrame,
Index(['total', 'e', 'a', 'b'], dtype='object'),
total e a b
name
!CHAOS Control System 282 80.14 39.01 1.42
Chromium EC 306 93.46 29.74 17.65
Firefox 5448 77.22 49.72 12.43
What happended to the name
column and how can I rename it afterwards?