Skip to content

Commit 6701ed3

Browse files
committed
FIX PandasObjects unhashable
1 parent 98ecede commit 6701ed3

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

RELEASE.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ pandas 0.11.1
220220
- Groupby transform with item-by-item not upcasting correctly (GH3740_)
221221
- Incorrectly read a HDFStore multi-index Frame witha column specification (GH3748_)
222222
- ``read_html`` now correctly skips tests (GH3741_)
223-
- DataFrames/Panel raise Type error when trying to hash (GH3882_)
223+
- PandasObjects raise TypeError when trying to hash (GH3882_)
224224
- Fix incorrect arguments passed to concat that are not list-like (e.g. concat(df1,df2)) (GH3481_)
225225
- Correctly parse when passed the ``dtype=str`` (or other variable-len string dtypes) in ``read_csv`` (GH3795_)
226226

pandas/core/generic.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ def save(self, path):
3131
def load(cls, path):
3232
return com.load(path)
3333

34+
def __hash__(self):
35+
raise TypeError('{0!r} objects are mutable, thus they cannot be'
36+
' hashed'.format(self.__class__.__name__))
37+
38+
3439
#----------------------------------------------------------------------
3540
# Axis name business
3641

@@ -594,10 +599,6 @@ def axes(self):
594599
def __repr__(self):
595600
return 'NDFrame'
596601

597-
def __hash__(self):
598-
raise TypeError('{0!r} objects are mutable, thus they cannot be'
599-
' hashed'.format(self.__class__.__name__))
600-
601602
@property
602603
def values(self):
603604
return self._data.as_matrix()

pandas/core/series.py

-4
Original file line numberDiff line numberDiff line change
@@ -527,10 +527,6 @@ def _constructor(self):
527527
def _can_hold_na(self):
528528
return not is_integer_dtype(self.dtype)
529529

530-
def __hash__(self):
531-
raise TypeError('{0!r} objects are mutable, thus they cannot be'
532-
' hashed'.format(self.__class__.__name__))
533-
534530
_index = None
535531
index = lib.SeriesIndex()
536532

0 commit comments

Comments
 (0)