core.components.common.load_dataframe#
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.
Functions#
|
Read a json file into a pandas DataFrame, optionally reset the index and sort |
Module Contents#
- core.components.common.load_dataframe.load_json_to_df(path: str, index_name: str | None, index_rename: str | None = None, sort_index: bool = True) pandas.DataFrame #
Read a json file into a pandas DataFrame, optionally reset the index and sort
- Parameters:
path – path to json or compressed json file (ie json.gz)
index_name – name of column to set as index.
index_rename – if given will rename the index to this
sort_index – sort the dataframe by its index
- Returns:
pd.Dataframe