Skip to content

Commit ed81ed0

Browse files
committed
Merge pull request #5000 from jreback/remove_factor
API: Remove deprecated Factor (GH3650)
2 parents 350febf + 5aa4897 commit ed81ed0

File tree

3 files changed

+2
-14
lines changed

3 files changed

+2
-14
lines changed

doc/source/release.rst

+1
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ API Changes
234234
Indexing on other index types are preserved (and positional fallback for ``[],ix``), with the exception, that floating point slicing
235235
on indexes on non ``Float64Index`` will raise a ``TypeError``, e.g. ``Series(range(5))[3.5:4.5]`` (:issue:`263`)
236236
- Make Categorical repr nicer (:issue:`4368`)
237+
- Remove deprecated ``Factor`` (:issue:`3650`)
237238

238239
Internal Refactoring
239240
~~~~~~~~~~~~~~~~~~~~

pandas/core/api.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from pandas.core.algorithms import factorize, match, unique, value_counts
77
from pandas.core.common import isnull, notnull
8-
from pandas.core.categorical import Categorical, Factor
8+
from pandas.core.categorical import Categorical
99
from pandas.core.format import (set_printoptions, reset_printoptions,
1010
set_eng_float_format)
1111
from pandas.core.index import Index, Int64Index, Float64Index, MultiIndex

pandas/core/categorical.py

-13
Original file line numberDiff line numberDiff line change
@@ -230,16 +230,3 @@ def describe(self):
230230
counts=counts,
231231
freqs=freqs,
232232
levels=self.levels)).set_index('levels')
233-
234-
235-
class Factor(Categorical):
236-
def __init__(self, labels, levels=None, name=None):
237-
from warnings import warn
238-
warn("Factor is deprecated. Use Categorical instead", FutureWarning)
239-
super(Factor, self).__init__(labels, levels, name)
240-
241-
@classmethod
242-
def from_array(cls, data):
243-
from warnings import warn
244-
warn("Factor is deprecated. Use Categorical instead", FutureWarning)
245-
return super(Factor, cls).from_array(data)

0 commit comments

Comments
 (0)