-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
System Information (please complete the following information):
- .NET Version: [e.g. .NET 6.0.301]
Describe the bug
Hi, Appending Dataframes (DataFrame.Append Method) doesn't seem to append based on column names, but appends based on the position. Is this normal?
To Reproduce
`var data = new DataFrame();
var col1 = new StringDataFrameColumn("ColumnA", new string[] { "a", "b", "c", "d", "e" });
var col2 = new Int32DataFrameColumn("ColumnB", new int[] { 1, 2, 3, 4, 5 });
var col3 = new Int32DataFrameColumn("ColumnC", new int[] { 10, 20, 30, 40, 50 });
var col4 = new StringDataFrameColumn("ColumnA", new string[] { "f", "g", "c", "d", "e" });
var col5 = new Int32DataFrameColumn("ColumnB", new int[] { 6, 7, 3, 4, 5 });
var col6 = new Int32DataFrameColumn("ColumnC", new int[] { 100, 200, 300, 400, 500 });
var dataFrame1 = new DataFrame(col1, col2, col3);
var dataFrame2 = new DataFrame(col4, col6, col5);
var dataFrames = new List { dataFrame1, dataFrame2 };
var resultDataFrame = dataFrame1.Append(dataFrame2.Rows);`
Exhibited behavior
| index | ColumnA | ColumnB | ColumnC |
|---|---|---|---|
| 0 | a | 1 | 10 |
| 1 | b | 2 | 20 |
| 2 | c | 3 | 30 |
| 3 | d | 4 | 40 |
| 4 | e | 5 | 50 |
| 5 | f | 100 | 6 |
| 6 | g | 200 | 7 |
| 7 | c | 300 | 3 |
| 8 | d | 400 | 4 |
| 9 | e | 500 | 5 |
Expected behavior
| index | ColumnA | ColumnB | ColumnC |
|---|---|---|---|
| 0 | a | 1 | 10 |
| 1 | b | 2 | 20 |
| 2 | c | 3 | 30 |
| 3 | d | 4 | 40 |
| 4 | e | 5 | 50 |
| 5 | f | 6 | 100 |
| 6 | g | 7 | 200 |
| 7 | c | 3 | 300 |
| 8 | d | 4 | 400 |
| 9 | e | 5 | 500 |