stencila/pyla

Python: Conversion between Datatable and Panda dataframe

Closed this issue · 0 comments

While Encoda provides for conversion between various file formats and this schema, the conversion to/from language runtime objects will be handled in the language packages developed here.

In stencila/schema#103, we have conversion between R's data.frame and the schema's Datatable: https://github.com/stencila/schema/blob/589adcff6b3c5db8c86a9c4a09b46db12f35278c/r/R/datatable.R. See also tests in that branch.

We need similar conversion between Datatable and Panda dataframe. See how we approached this previously:

from DataFrame: https://github.com/stencila/py/blob/f12607960ffe8b68c1d3f0ee7df34b3d094fc58d/stencila/value.py#L90-L121

to DataFrame: https://github.com/stencila/py/blob/f12607960ffe8b68c1d3f0ee7df34b3d094fc58d/stencila/value.py#L366-L369