LECA.prep.import_data

LECA.prep.import_data(json_directories: List[str] = [], path_to_csv: str = 'json_import.csv', mode: str = 'append', verbose: bool = True) DataFrame

Function for importing json data following the BIG-MAP json formatting standard.

Parameters:
  • json_directories (List[str], optional) –

    String list of the directories (relative to notebook directory) to pull the json files from. It will pull every .json file in each listed directory and load them into a labeled DataFrame

    By default [].

  • path_to_csv (str, optional) –

    Path to formatted csv file. If file already exists, import_data will extend the file

    By default “json_import.csv”.

  • mode (str, optional) –

    Import mode. Choose among:

    • ”read_csv”, read in the data from the csv file (ignores the data folders)

    • ”append”, read in data from csv file, append all data from the listed jsons files and save to csv

    • ”overwrite”, read in data from jsons, replace csv file with data from jsons

    By default “append”.

  • verbose (bool) –

    Toggle whether to output information about import process

    By default True

Returns:

Pandas DataFrame with labeled columns and one row for each measurement

If the data in the json file cannot be properly parsed, returns instead the DataFrame for the failed .json import to trace the issue

Return type:

DataFrame