Map to Deedle Frame

回眸只為那壹抹淺笑 提交于 2019-12-06 12:38:55

In the type annotation of the folderFnct, you have aFrame:Frame. However, the type representing data frames is a generic type with two type arguments (representing the type of index for rows and columns, respectively), so the annotation should be aFrame:Frame<_, _>.

Another way to add series to a frame is to use mutating operation:

aFrame.AddSeries(colName, newSeries)

However, this only supports left join (data frame can only be mutated by adding new series, but not in a way that would change the index). However, you might be able to use this approach and then drop all missing values from the frame once it is constructed.

EDIT: To answer the question about generic types:

  • Series<K, V> represents series with keys of type K containing values of type V (e.g. series with ordinarily indexed observations would have K=int and V=float)

  • Frame<R, C> represents a frame that contains heterogeneous data (of potentially varying types for each column) where the rows are indexed by R and columns are indexed by C. For ordinarily indexed frame R=int and typically, your columns will be named so C=string (but you can have other indices too)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!