-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(PandasDataFrameItem): Use JSON to serialize dataframe instead of …
…pickle (#621) Pandas Dataframes including complex objects (e.g. numpy arrays) were stored as-is. They are now serialized using JSON to make them environment-independent. --- Two native methods are available to serialize dataframe with multi-index, while keepping the index names: 1. Using table orientation with JSON serializer: ```python json = dataframe.to_json(orient="table") dataframe = pandas.read_json(json, orient="table", dtype=False) ``` This method fails when columns name is an integer. 2. Using record orientation with indexes as columns: ```python dataframe = dataframe.reset_index() json = dataframe.to_json(orient="records") dataframe = pandas.read_json(json, orient="records", dtype=False) ``` This method fails when the index has the same name as one of the columns. None of those methods being compatible, we decide to store indexes separately.
- Loading branch information
1 parent
1571501
commit 5f2f229
Showing
4 changed files
with
119 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters