Skip to content

Commit

Permalink
use fillna instead of replace
Browse files Browse the repository at this point in the history
  • Loading branch information
sheppard committed Oct 18, 2014
1 parent 9880bef commit 35c767d
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions rest_pandas/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@ def get_dataframe(self, data):
if index:
if self.index_none_value is not None:
for key in index:
dataframe.replace(
{key: None},
{key: self.index_none_value},
inplace=True,
)
dataframe[key].fillna(self.index_none_value, inplace=True)
dataframe.set_index(index, inplace=True)
else:
# Name auto-index column to ensure valid CSV output
Expand Down

0 comments on commit 35c767d

Please sign in to comment.