-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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: Panel reference from documentation #25649
Merged
Merged
Changes from 8 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
7d56c07
CLN: Panel docs
818aa57
More reference removal
bc69935
NotImplementedError in the future?
92ec876
More grammar fixing
cde9151
Remove unused import
5a8046a
Address review
31c75fb
Merge remote-tracking branch 'upstream/master' into remove_panel_doc
6adc59d
Merge remote-tracking branch 'upstream/master' into remove_panel_doc
3e2c0a0
Merge remote-tracking branch 'upstream/master' into remove_panel_doc
b11e3d4
Remove errant panel store op
cbd6bd3
remove document section references from old whatsnew entries
b865434
Truncate information in panel.rst. Leave note about removal
4ad62f9
Merge remote-tracking branch 'upstream/master' into remove_panel_doc
8829954
Add Panel removal warning and link to 0.24 docs
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,9 +16,6 @@ the previous section: | |
s = pd.Series(np.random.randn(5), index=['a', 'b', 'c', 'd', 'e']) | ||
df = pd.DataFrame(np.random.randn(8, 3), index=index, | ||
columns=['A', 'B', 'C']) | ||
wp = pd.Panel(np.random.randn(2, 5, 4), items=['Item1', 'Item2'], | ||
major_axis=pd.date_range('1/1/2000', periods=5), | ||
minor_axis=['A', 'B', 'C', 'D']) | ||
.. _basics.head_tail: | ||
|
||
|
@@ -46,7 +43,6 @@ pandas objects have a number of attributes enabling you to access the metadata | |
* Axis labels | ||
* **Series**: *index* (only axis) | ||
* **DataFrame**: *index* (rows) and *columns* | ||
* **Panel**: *items*, *major_axis*, and *minor_axis* | ||
|
||
Note, **these attributes can be safely assigned to**! | ||
|
||
|
@@ -118,7 +114,7 @@ columns, :meth:`DataFrame.to_numpy` will return the underlying data: | |
df.to_numpy() | ||
If a DataFrame or Panel contains homogeneously-typed data, the ndarray can | ||
If a DataFrame contains homogeneously-typed data, the ndarray can | ||
actually be modified in-place, and the changes will be reflected in the data | ||
structure. For heterogeneous data (e.g. some of the DataFrame's columns are not | ||
all the same dtype), this will not be the case. The values attribute itself, | ||
|
@@ -239,26 +235,6 @@ Furthermore you can align a level of a MultiIndexed DataFrame with a Series. | |
names=['first', 'second']) | ||
dfmi.sub(column, axis=0, level='second') | ||
With Panel, describing the matching behavior is a bit more difficult, so | ||
the arithmetic methods instead (and perhaps confusingly?) give you the option | ||
to specify the *broadcast axis*. For example, suppose we wished to demean the | ||
data over a particular axis. This can be accomplished by taking the mean over | ||
an axis and broadcasting over the same axis: | ||
|
||
.. ipython:: python | ||
major_mean = wp.mean(axis='major') | ||
major_mean | ||
wp.sub(major_mean, axis='major') | ||
And similarly for ``axis="items"`` and ``axis="minor"``. | ||
|
||
.. note:: | ||
|
||
I could be convinced to make the **axis** argument in the DataFrame methods | ||
match the broadcasting behavior of Panel. Though it would require a | ||
transition period so users can change their code... | ||
|
||
Series and Index also support the :func:`divmod` builtin. This function takes | ||
the floor division and modulo operation at the same time returning a two-tuple | ||
of the same type as the left hand side. For example: | ||
|
@@ -407,7 +383,7 @@ This is because NaNs do not compare as equals: | |
np.nan == np.nan | ||
So, NDFrames (such as Series, DataFrames, and Panels) | ||
So, NDFrames (such as Series and DataFrames) | ||
have an :meth:`~DataFrame.equals` method for testing equality, with NaNs in | ||
corresponding locations treated as equal. | ||
|
||
|
@@ -515,7 +491,7 @@ Descriptive statistics | |
|
||
There exists a large number of methods for computing descriptive statistics and | ||
other related operations on :ref:`Series <api.series.stats>`, :ref:`DataFrame | ||
<api.dataframe.stats>`, and :ref:`Panel <api.panel.stats>`. Most of these | ||
<api.dataframe.stats>`. Most of these | ||
are aggregations (hence producing a lower-dimensional result) like | ||
:meth:`~DataFrame.sum`, :meth:`~DataFrame.mean`, and :meth:`~DataFrame.quantile`, | ||
but some of them, like :meth:`~DataFrame.cumsum` and :meth:`~DataFrame.cumprod`, | ||
|
@@ -525,8 +501,6 @@ specified by name or integer: | |
|
||
* **Series**: no axis argument needed | ||
* **DataFrame**: "index" (axis=0, default), "columns" (axis=1) | ||
* **Panel**: "items" (axis=0), "major" (axis=1, default), "minor" | ||
(axis=2) | ||
|
||
For example: | ||
|
||
|
@@ -1481,15 +1455,14 @@ Iteration | |
|
||
The behavior of basic iteration over pandas objects depends on the type. | ||
When iterating over a Series, it is regarded as array-like, and basic iteration | ||
produces the values. Other data structures, like DataFrame and Panel, | ||
produces the values. Other data structures, like DataFrame, | ||
follow the dict-like convention of iterating over the "keys" of the | ||
objects. | ||
|
||
In short, basic iteration (``for i in object``) produces: | ||
|
||
* **Series**: values | ||
* **DataFrame**: column labels | ||
* **Panel**: item labels | ||
|
||
Thus, for example, iterating over a DataFrame gives you the column names: | ||
|
||
|
@@ -1559,13 +1532,12 @@ through key-value pairs: | |
|
||
* **Series**: (index, scalar value) pairs | ||
* **DataFrame**: (column, Series) pairs | ||
* **Panel**: (item, DataFrame) pairs | ||
|
||
For example: | ||
|
||
.. ipython:: python | ||
for item, frame in wp.iteritems(): | ||
for item, frame in df.iteritems(): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense though was this not failing CI before? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
print(item) | ||
print(frame) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not true yet, but I would think this would raise a
NotImplementedError
once panel is removed?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me. FYI there's a call above this for
to_panel
I imagine we want to removeThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch. Removed.