Skip to content

Commit

Permalink
Merge pull request #17 from Kirill-Lekhov/master
Browse files Browse the repository at this point in the history
Simplified the replace_null_objects function in the pandasplus module
  • Loading branch information
m1kc authored Jun 1, 2022
2 parents 6b1438e + 0477adc commit 65f5cc6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions notalib/pandas/pandasplus.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from pandas import DataFrame, NaT, notnull
from pandas import DataFrame, notnull


def row_to_dict(d, key_as=None):
Expand Down Expand Up @@ -32,7 +32,6 @@ def replace_null_objects(dataframe: DataFrame, new_value=None) -> DataFrame:
it to None, I recommend using this function.
"""

dataframe = dataframe.replace({NaT: new_value})
dataframe = dataframe.where(notnull(dataframe), new_value)

return dataframe

0 comments on commit 65f5cc6

Please sign in to comment.