convert_df_to_json_array#

convert_df_to_json_array(df, cols, int_cols=None)[source]#

Convert desired data from a pandas dataframe into a json array.

Parameters:
  • df (pandas dataframe) – the dataframe with data

  • cols (list) – list of the columns to convert to the json array format

  • int_cols (str or list) – a str or list of columns to convert to integer values

Returns:

An array version of the pandas dataframe to be added to synthpops json data objects.

Return type:

array