Convert data

Convert the main dataframe to various formats

To web formats

Export.to_html_() → str

Convert the main dataframe to html

Returns:html data
Return type:str
Example:ds.to_html_()
Export.to_json_() → str

Convert the main dataframe to json

Returns:json data
Return type:str
Example:ds.to_json_()
Export.to_javascript_(table_name: str = 'data') → str

Convert the main dataframe to javascript code

Parameters:
  • table_name – javascript variable name, defaults to “data”
  • table_name – str, optional
Returns:

a javascript constant with the data

Return type:

str

Example:

ds.to_javastript_("myconst")

To data formats

Export.to_markdown_() → str

Convert the main dataframe to markdown

Returns:markdown data
Return type:str
Example:ds.to_markdown_()
Export.to_rst_() → str

Convert the main dataframe to restructured text

Returns:rst data
Return type:str
Example:ds.to_rst_()
Export.to_records_() → dict

Returns a list of dictionary records from the main dataframe

Returns:a python dictionnary with the data
Return type:str
Example:ds.to_records_()
Export.to_numpy_(table_name: str = 'data') → numpy.array

Convert the main dataframe to a numpy array

Parameters:
  • table_name – name of the python variable, defaults to “data”
  • table_name – str, optional
Returns:

a numpy array

Return type:

np.array

Example:

ds.to_numpy_("myvar")

To python code

Export.to_python_(table_name: str = 'data') → list

Convert the main dataframe to python a python list

Parameters:
  • table_name – python variable name, defaults to “data”
  • table_name – str, optional
Returns:

a python list of lists with the data

Return type:

str

Example:

ds.to_python_("myvar")