-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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
CLN: Post Series subclass from NDFrame #4324
Comments
@jreback What do you think about a This would happen after the |
in #3482 I basically just moved align to generic, and all it really does is make calls out to So would +1 be in favor of that. maybe create a new module though, |
is refactor label differen tthan internals? |
internals could be for things/ideas like discussions around the |
While my alignment does "work" for nd objects it's not clear that there's a "right" way to do it. E.g., what axis should a |
i'll open a new issue for this to prevent too much OT stuff here |
@jreback - I have most of the arithmetic refactor done - but I'd like to discuss a few decisions. Does it make sense for me to open it as a separate PR right now (based off your branch) so (hopefully) it can make it in soon after your big Series change? |
that's totally fine |
Yeah, I just tag your current master when I rebase, and then cherry-pick, which makes it pretty painless, basically:
|
git fu master! |
@jtratner nice! |
let me see if i follow that
so essentially u r creating a new tag with ur changes every time @jreback rebases is that correct? |
@cpcloud well, you have to create the tag before @jreback rebases (so it's the base for your current work), but yes, each time I basically move the base commit tag to be the last commit of series2. i.e. git checkout some-branch-that-might-rebase
git tag base_commit some-branch-that-might-rebase
git checkout -b my-branch and then after git fetch # or merge or whatever
git checkout some-branch-that-might-rebase
git cherry-pick base_commit..my-branch
# now, update the tag to be the new base commit
git tag -d base_commit
git tag base_commit some-branch-that-might-rebase and then you can do whatever else you want |
but yes, that's basically it. I like it because you don't have to remember any hashes. |
just to play devils advocate how is this different from just git fetch jreback
git checkout arithmethic-refactor
git rebase jreback/td |
@cpcloud what if upstream combines multiple previous commits? I only want to apply my commits on top of wherever it ended up. |
ah i see, so yours takes into account possible rewritten history and you don't really care if that's happened....that is pretty useful....care to add to git tips when u get a chance? |
what if the commit that series2_base is deleted, eg rebased away upstream? |
@jreback you'll always have it locally, because that's in the history of the local branch you're working on. the cherry-pick just runs off of the refs you say. and |
@cpcloud I added it to the git tips with some additional explanation and a hopefully strongly worded note so newbies to git don't read it and think they need to do that off master. (which would work, but add extra complexity for them) |
I'm not sure if this is the right place to ask, but is there a reason for the Panel constructor not taking a dict of Series? In [26]: a = pd.Series(np.random.randn(4))
In [27]: b = pd.Series(np.random.randn(4), index=np.arange(1, 5))
In [28]: pd.Panel({'a': a, 'b': b}) will results in ---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-28-bb125e2a1174> in <module>()
----> 1 pd.Panel({'a': a, 'b': b})
/Users/tom/python2.7/lib/python2.7/site-packages/pandas-0.12.0_169_gb2ad044-py2.7-macosx-10.8-x86_64.egg/pandas/core/panel.pyc in __init__(self, data, items, major_axis, minor_axis, copy, dtype)
234 self._init_data(
235 data=data, items=items, major_axis=major_axis, minor_axis=minor_axis,
--> 236 copy=copy, dtype=dtype)
237
238 def _init_data(self, data, copy, dtype, **kwargs):
/Users/tom/python2.7/lib/python2.7/site-packages/pandas-0.12.0_169_gb2ad044-py2.7-macosx-10.8-x86_64.egg/pandas/core/panel.pyc in _init_data(self, data, copy, dtype, **kwargs)
252 mgr = data
253 elif isinstance(data, dict):
--> 254 mgr = self._init_dict(data, passed_axes, dtype=dtype)
255 copy = False
256 dtype = None
/Users/tom/python2.7/lib/python2.7/site-packages/pandas-0.12.0_169_gb2ad044-py2.7-macosx-10.8-x86_64.egg/pandas/core/panel.pyc in _init_dict(self, data, axes, dtype)
293 # extract axis for remaining axes & create the slicemap
294 raxes = [self._extract_axis(self, data, axis=i)
--> 295 if a is None else a for i, a in enumerate(axes)]
296 raxes_sm = self._extract_axes_for_slice(self, raxes)
297
/Users/tom/python2.7/lib/python2.7/site-packages/pandas-0.12.0_169_gb2ad044-py2.7-macosx-10.8-x86_64.egg/pandas/core/panel.pyc in _extract_axis(self, data, axis, intersect)
1560 elif v is not None:
1561 have_raw_arrays = True
-> 1562 raw_lengths.append(v.shape[axis])
1563
1564 if have_frames:
IndexError: tuple index out of range Obviously I can just recast |
@TomAugspurger its not obvious what the axes should be here (you only specified 2, but you need 3). Maybe need a better error message on that. |
@TomAugspurger already had one, see #4185, would welcome a PR on this! |
Thanks. I see what you're saying about the axes. |
moving unchecked to #5044 |
After #3482 is merged, some additional methods to fixup
deep=True
is implemented incore/internals/copy
, related to ENH/BUG: Fix names, levels and labels handling in MultiIndex #4039, PR API/CLN: make rename and copy consistent across NDFrame #4627tests/test_generic.py
(ones that should have a conforming API, e.g.replace,filter
) see ENH: unify the replace API #4118, (test_generic is created via API/CLN: make rename and copy consistent across NDFrame #4627)AXIS_LEN
check infilter
, PR CLN: _axis_len checking cleanup and better message #4855Series/DataFrame
interpolation tointernals.Block.interpolatte
, ENH: Richer options forinterpolate
andresample
#4434, cc @TomAugspurgerBlock.setitem
(core/indexing), PR API/CLN: setitem in Series now consistent with DataFrame #4624remove use of common/_maybe_upcast_putmask and possibly_cast_itemThe text was updated successfully, but these errors were encountered: