Skip to content

Commit

Permalink
Fixed NaN
Browse files Browse the repository at this point in the history
  • Loading branch information
khoroshevskyi committed Jan 11, 2024
1 parent b2fcc23 commit 0872352
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
5 changes: 5 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) and [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format.

## [0.40.1] -- 2024-01-11
### Fixed
- Initializing Project with `NaN` value instead of `None` in `from_pandas` method


## [0.40.0] -- 2023-12-18

**This version introduced backwards-incompatible changes.**
Expand Down
2 changes: 1 addition & 1 deletion peppy/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.40.0"
__version__ = "0.40.1"
6 changes: 4 additions & 2 deletions peppy/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,15 @@ def _from_dict(self, pep_dictionary) -> "Project":
_samples: list | dict,
_subsamples: list[list | dict]}
"""
self[SAMPLE_DF_KEY] = pd.DataFrame(pep_dictionary[SAMPLE_RAW_DICT_KEY])
self[SAMPLE_DF_KEY] = pd.DataFrame(pep_dictionary[SAMPLE_RAW_DICT_KEY]).replace(
np.nan, "None"
)
self[CONFIG_KEY] = pep_dictionary[CONFIG_KEY]

if SUBSAMPLE_RAW_LIST_KEY in pep_dictionary:
if pep_dictionary[SUBSAMPLE_RAW_LIST_KEY]:
self[SUBSAMPLE_DF_KEY] = [
pd.DataFrame(sub_a)
pd.DataFrame(sub_a).replace(np.nan, "None")
for sub_a in pep_dictionary[SUBSAMPLE_RAW_LIST_KEY]
]
if NAME_KEY in self[CONFIG_KEY]:
Expand Down

0 comments on commit 0872352

Please # to comment.