Skip to content

Subclassed reshape clean #15655

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

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
642bfce
add subclassed stack/unstack/pivot tests
delgadom Mar 8, 2017
0295604
add melt test
delgadom Mar 8, 2017
60a2cfd
use _constructor* properties to create Series and DataFrame objects t…
delgadom Mar 8, 2017
d65cff5
document _Unstacker
delgadom Mar 8, 2017
9d1cf63
fix bug in wide_to_long_test, add GH issue numbers
delgadom Mar 11, 2017
3efb82f
add whatsnew entry
delgadom Mar 11, 2017
200c752
flake8 cleanup
delgadom Mar 11, 2017
5e480c6
fix bug in existing docs ``internals.rst:220`` ``{A, [`` --> ``{A: [``
delgadom Mar 11, 2017
4f3319c
clarify language and add subclassed reshape and math examples to doc/…
delgadom Mar 11, 2017
8af21c1
additional clarification in doc/source/internals.rst
delgadom Mar 11, 2017
027f36a
remove references to Panel from doc/source/internals.rst subclassing …
delgadom Mar 11, 2017
8a61374
change code-block to ipython directives in doc/source/internals.rst
delgadom Mar 12, 2017
6715a25
change from python to ipython code blocks in docs
delgadom May 13, 2017
f751a85
reformat docstrings
delgadom May 13, 2017
ca85796
add subclassed stack/unstack/pivot tests
delgadom Mar 8, 2017
b0bc8f4
add melt test
delgadom Mar 8, 2017
246a464
use _constructor* properties to create Series and DataFrame objects t…
delgadom Mar 8, 2017
1c672a9
document _Unstacker
delgadom Mar 8, 2017
eff151e
fix bug in wide_to_long_test, add GH issue numbers
delgadom Mar 11, 2017
16dae8e
flake8 cleanup
delgadom Mar 11, 2017
66b2e42
fix bug in existing docs ``internals.rst:220`` ``{A, [`` --> ``{A: [``
delgadom Mar 11, 2017
7641812
clarify language and add subclassed reshape and math examples to doc/…
delgadom Mar 11, 2017
be66ce0
additional clarification in doc/source/internals.rst
delgadom Mar 11, 2017
d27034d
remove references to Panel from doc/source/internals.rst subclassing …
delgadom Mar 11, 2017
dc3b07e
merge conflicts
delgadom May 13, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
flake8 cleanup
  • Loading branch information
delgadom committed May 13, 2017
commit 16dae8e0415413b4d0e0581adba08dc5ef512f53
3 changes: 2 additions & 1 deletion pandas/core/reshape/reshape.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ class _Unstacker(object):
float and missing values will be set to NaN.

constructor : object, default DataFrame
``Series``, ``DataFrame``, or subclass used to create unstacked response
``Series``, ``DataFrame``, or subclass used to create unstacked
response

Examples
--------
Expand Down
10 changes: 5 additions & 5 deletions pandas/tests/frame/test_subclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,10 @@ def test_subclass_pivot(self):
def test_subclassed_melt(self):
# GH 15564
cheese = tm.SubclassedDataFrame({
'first' : ['John', 'Mary'],
'last' : ['Doe', 'Bo'],
'height' : [5.5, 6.0],
'weight' : [130, 150]})
'first': ['John', 'Mary'],
'last': ['Doe', 'Bo'],
'height': [5.5, 6.0],
'weight': [130, 150]})

melted = pd.melt(cheese, id_vars=['first', 'last'])

Expand Down Expand Up @@ -310,7 +310,7 @@ def test_subclassed_wide_to_long(self):
expected = tm.SubclassedDataFrame(exp_data)
expected = expected.set_index(['id', 'year'])[["X", "A", "B"]]
long_frame = pd.wide_to_long(df, ["A", "B"], i="id", j="year")

tm.assert_frame_equal(long_frame, expected)
tm.assertIsInstance(long_frame, tm.SubclassedDataFrame)

Expand Down