Pandas: Rename Axis In Df May 25, 2024 Post a Comment I have a df which looks like this: Column 1 Channel Apples 1.0 Oranges 2.0 Puppies 3.0 Ducks 4.0 I would likeSolution 1: This is kind of a hack to get you what you eventually wanted it to look like.df = pd.read_csv(data, sep='\s{2,}', index_col='Channel', engine='python') dfCopydf_excel_format = df.rename_axis('Channel', axis=1) del(df_excel_format.index.name) df_excel_format Copy Share Post a Comment for "Pandas: Rename Axis In Df"
Post a Comment for "Pandas: Rename Axis In Df"