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
System Information (please complete the following information):
OS & Version: [e.g. Windows 10]
ML.NET Version: ML.NET 0.18.0
.NET Version: .net Framework 4.8
Describe the bug
Changing the name of a column in a DataFrame doesn't change the name you use to access the column
To Reproduce
Steps to reproduce the behavior:
StringDataFrameColumn city = new StringDataFrameColumn("City", new string[] { "London", "Berlin" });
PrimitiveDataFrameColumn<int> temp = new PrimitiveDataFrameColumn<int>("Temperature", new int[] { 12, 13 });
DataFrame dataframe = new DataFrame(city, temp);
Console.WriteLine((string)dataframe["City"][0]);
// Change the name of the column:
dataframe["City"].SetName("Stadt");
// Still accessed as "City" but is named Stadt
Console.WriteLine(dataframe["City"].Name);
// Accessing as "Stadt" cause an exception
Console.WriteLine((string)dataframe["Stadt"][0]);
Expected behavior
That the column name inside the DataFrame gets updated so it can be accessed as:
dataframe["new name"]
Additional context
Would be great if one could change the name of a column and get a new column where the name is new but it points to the same data. (Useful for my use case, and perhaps valuable for others too.)
The text was updated successfully, but these errors were encountered:
System Information (please complete the following information):
Describe the bug
Changing the name of a column in a DataFrame doesn't change the name you use to access the column
To Reproduce
Steps to reproduce the behavior:
Expected behavior
That the column name inside the DataFrame gets updated so it can be accessed as:
dataframe["new name"]
Additional context
Would be great if one could change the name of a column and get a new column where the name is new but it points to the same data. (Useful for my use case, and perhaps valuable for others too.)
The text was updated successfully, but these errors were encountered: