diff --git a/.gitignore b/.gitignore index 4bbbcad0c97ad..96b1f945870de 100644 --- a/.gitignore +++ b/.gitignore @@ -61,6 +61,7 @@ dist .coverage coverage.xml coverage_html_report +*.pytest_cache # OS generated files # ###################### @@ -90,7 +91,6 @@ scikits # Unit / Performance Testing # ############################## -.pytest_cache/ asv_bench/env/ asv_bench/html/ asv_bench/results/ diff --git a/pandas/core/arrays/categorical.py b/pandas/core/arrays/categorical.py index b37f88d8bfdce..1e5e2d1163060 100644 --- a/pandas/core/arrays/categorical.py +++ b/pandas/core/arrays/categorical.py @@ -1627,14 +1627,6 @@ def fillna(self, value=None, method=None, limit=None): values = self._codes - # Make sure that we also get NA in categories - if self.categories.dtype.kind in ['S', 'O', 'f']: - if np.nan in self.categories: - values = values.copy() - nan_pos = np.where(isna(self.categories))[0] - # we only have one NA in categories - values[values == nan_pos] = -1 - # pad / bfill if method is not None: