You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This would be very helpful from the perspective of Polyglot Notebooks and trying to do the same types of things you can do in Pandas, but with DataFrame. Right now it's not intuitive how you rename an existing column in a DataFrame.
Update: I went through the code and did find the DataFrameColumn.SetName method. It wasn't showing up for me in Polyglot Notebooks intellisense, but it's present and it works.
That said, a more intuitive way of doing this would be with syntax like df["X1"].Name = "Credit Amount"; or df["X1"].Rename("Credit Amount"); or df.Rename("X1", "Credit Amount"); or possibly a df.Rename that takes in a Dictionary<string, string> for bulk renaming like Pandas rename does. Even making the Name property have a public setter would help.
Activity
[-]Rename columns[/-][+]DataFrame - Rename columns[/+]QuantumHope commentedon Oct 25, 2023
This would be very helpful from the perspective of Polyglot Notebooks and trying to do the same types of things you can do in Pandas, but with DataFrame. Right now it's not intuitive how you rename an existing column in a DataFrame.
Update: I went through the code and did find the
DataFrameColumn.SetNamemethod. It wasn't showing up for me in Polyglot Notebooks intellisense, but it's present and it works.That said, a more intuitive way of doing this would be with syntax like
df["X1"].Name = "Credit Amount";ordf["X1"].Rename("Credit Amount");ordf.Rename("X1", "Credit Amount");or possibly adf.Renamethat takes in aDictionary<string, string>for bulk renaming like Pandasrenamedoes. Even making theNameproperty have a public setter would help.rosebyte commentedon Sep 29, 2026
Triage: We think the SetName does the job well. It's a pity Polyglot Notebooks doesn't see the method, but it might be fixed rather there.