Why does pd.groupby need the __eq__ method to be implemented? Shouldn’t __hash__ be enough? /u/pstmps Python Education

Sorry if this is the wrong place to post this. I implemented a custom data type for pandas and want to use groupby. I need both eq and hash to be implemented, which isn’t a problem, but I can’t wrap my head around why. ( I can’t implement lt le_ etc. but that’s ok, I use sort=False). I took a look at the source code but I can’t understand it yet. Any help is appreciated.

submitted by /u/pstmps
[link] [comments]

​r/learnpython Sorry if this is the wrong place to post this. I implemented a custom data type for pandas and want to use groupby. I need both eq and hash to be implemented, which isn’t a problem, but I can’t wrap my head around why. ( I can’t implement lt le_ etc. but that’s ok, I use sort=False). I took a look at the source code but I can’t understand it yet. Any help is appreciated. submitted by /u/pstmps [link] [comments] 

Sorry if this is the wrong place to post this. I implemented a custom data type for pandas and want to use groupby. I need both eq and hash to be implemented, which isn’t a problem, but I can’t wrap my head around why. ( I can’t implement lt le_ etc. but that’s ok, I use sort=False). I took a look at the source code but I can’t understand it yet. Any help is appreciated.

submitted by /u/pstmps
[link] [comments] 

Leave a Reply

Your email address will not be published. Required fields are marked *