Skip to content

Commit

Permalink
add code sample for pandas-dev#40472
Browse files Browse the repository at this point in the history
  • Loading branch information
simonjayhawkins committed Jun 7, 2021
1 parent 2714184 commit bc12c51
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions bisect/40472.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# BUG: series.replace(np.nan,..) on categorical series does not replace #40472


import numpy as np
import pandas as pd

print(pd.__version__)

s = pd.Series({1: np.nan, 2: "b"}).astype("category")
result = s.replace(np.nan, "c")
print(result)

assert result[1] == "c"

0 comments on commit bc12c51

Please sign in to comment.