-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Fixed metadata propagation in DataFrame.__getitem__ #37037
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed metadata propagation in DataFrame.__getitem__ #37037
Conversation
can you merge master (i think should be good then) |
There's a deeper problem here. In [10]: other = pd.DataFrame({"name": [1, 2]})
In [11]: self.__finalize__(other)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-11-0a67385a6694> in <module>
----> 1 self.__finalize__(other)
~/Envs/dask-dev/lib/python3.8/site-packages/pandas/core/generic.py in __finalize__(self, other, method, **kwargs)
5115 for name in self._metadata:
5116 assert isinstance(name, str)
-> 5117 object.__setattr__(self, name, getattr(other, name, None))
5118 return self
5119
~/Envs/dask-dev/lib/python3.8/site-packages/pandas/core/series.py in name(self, value)
493 def name(self, value: Label) -> None:
494 if not is_hashable(value):
--> 495 raise TypeError("Series.name must be a hashable type")
496 object.__setattr__(self, "_name", value)
497
TypeError: Series.name must be a hashable type I'll think a bit about this. |
This pull request is stale because it has been open for thirty days with no activity. Please update or respond to this comment if you're still interested in working on this. |
|
thanks @TomAugspurger |
xref #28283