'Microsoft.Data.Analysis - How should I normalize the length of a collection of columns?

I'm trying to normalize the length of columns I'm storing in a List<DataFrameColumn> in order to eventually build a DataFrame with them.

  • This list contains various columns of types StringDataFrameColumn and PrimitiveDataFrameColumn<T>. I'm using List<DataFrameColumn> since DataFrameColumn is the common base type of all objects in the List.
  • I'm doing this by finding the longest column in the list and then attempting to Append() to all columns that are shorter than this.
  • However, because iterating through the list returns DataFrameColumn and DataFrameColumn does not have an Append() method, I cannot do this.

So, my questions is, should I use a List<Object> instead, or is there a better way to do this that I'm missing?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source