save_as_json

save_as_json(data, save_path)[source]

Save data to a json file.

The function will deepcopy the data and then jsonify the content in place. Support data types for jsonify consist of str, int, float, bool and their np.ndarray respectively.

Parameters
  • data (dict or list) – Input data to save.

  • save_path (str) – Output to save the json of input.