-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: Fix flake8 issues in whatsnew v10* and v11* #24277
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
a3f42af
DOC: Flake-8 Fixes for whatsnew v0.10.*
saurav-chakravorty 3cd4a27
DOC: Fix Flake8 issues with whatsnew v0.11.0
saurav-chakravorty e43d1ec
DOC: added header back
saurav-chakravorty 1ed46ec
Merge remote-tracking branch 'upstream/master' into whatsnew-10
saurav-chakravorty 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 hidden or 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 hidden or 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 |
---|---|---|
|
@@ -3,13 +3,6 @@ | |
v0.10.1 (January 22, 2013) | ||
--------------------------- | ||
|
||
{{ header }} | ||
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. restore the header here too |
||
|
||
.. ipython:: python | ||
:suppress: | ||
|
||
from pandas import * # noqa F401, F403 | ||
|
||
|
||
This is a minor release from 0.10.0 and includes new features, enhancements, | ||
and bug fixes. In particular, there is substantial new HDFStore functionality | ||
|
@@ -47,6 +40,7 @@ You may need to upgrade your existing data files. Please visit the | |
.. ipython:: python | ||
:suppress: | ||
:okexcept: | ||
import os | ||
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. I think we need a blank line before the import here |
||
|
||
os.remove('store.h5') | ||
|
||
|
@@ -55,17 +49,18 @@ perform queries on a table, by passing a list to ``data_columns`` | |
|
||
.. ipython:: python | ||
|
||
store = HDFStore('store.h5') | ||
df = DataFrame(randn(8, 3), index=date_range('1/1/2000', periods=8), | ||
columns=['A', 'B', 'C']) | ||
store = pd.HDFStore('store.h5') | ||
df = pd.DataFrame(np.random.randn(8, 3), | ||
index=pd.date_range('1/1/2000', periods=8), | ||
columns=['A', 'B', 'C']) | ||
df['string'] = 'foo' | ||
df.loc[df.index[4:6], 'string'] = np.nan | ||
df.loc[df.index[7:9], 'string'] = 'bar' | ||
df['string2'] = 'cool' | ||
df | ||
|
||
# on-disk operations | ||
store.append('df', df, data_columns = ['B','C','string','string2']) | ||
store.append('df', df, data_columns=['B', 'C', 'string', 'string2']) | ||
store.select('df', "B>0 and string=='foo'") | ||
|
||
# this is in-memory version of this type of selection | ||
|
@@ -77,16 +72,16 @@ Retrieving unique values in an indexable or data column. | |
|
||
# note that this is deprecated as of 0.14.0 | ||
# can be replicated by: store.select_column('df','index').unique() | ||
store.unique('df','index') | ||
store.unique('df','string') | ||
store.unique('df', 'index') | ||
store.unique('df', 'string') | ||
|
||
You can now store ``datetime64`` in data columns | ||
|
||
.. ipython:: python | ||
|
||
df_mixed = df.copy() | ||
df_mixed['datetime64'] = Timestamp('20010102') | ||
df_mixed.loc[df_mixed.index[3:4], ['A','B']] = np.nan | ||
df_mixed = df.copy() | ||
df_mixed['datetime64'] = pd.Timestamp('20010102') | ||
df_mixed.loc[df_mixed.index[3:4], ['A', 'B']] = np.nan | ||
|
||
store.append('df_mixed', df_mixed) | ||
df_mixed1 = store.select('df_mixed') | ||
|
@@ -99,21 +94,21 @@ columns, this is equivalent to passing a | |
|
||
.. ipython:: python | ||
|
||
store.select('df',columns = ['A','B']) | ||
store.select('df', columns=['A', 'B']) | ||
|
||
``HDFStore`` now serializes MultiIndex dataframes when appending tables. | ||
|
||
.. code-block:: ipython | ||
|
||
In [19]: index = MultiIndex(levels=[['foo', 'bar', 'baz', 'qux'], | ||
....: ['one', 'two', 'three']], | ||
....: labels=[[0, 0, 0, 1, 1, 2, 2, 3, 3, 3], | ||
....: [0, 1, 2, 0, 1, 1, 2, 0, 1, 2]], | ||
....: names=['foo', 'bar']) | ||
In [19]: index = pd.MultiIndex(levels=[['foo', 'bar', 'baz', 'qux'], | ||
....: ['one', 'two', 'three']], | ||
....: labels=[[0, 0, 0, 1, 1, 2, 2, 3, 3, 3], | ||
....: [0, 1, 2, 0, 1, 1, 2, 0, 1, 2]], | ||
....: names=['foo', 'bar']) | ||
....: | ||
|
||
In [20]: df = DataFrame(np.random.randn(10, 3), index=index, | ||
....: columns=['A', 'B', 'C']) | ||
In [20]: df = pd.DataFrame(np.random.randn(10, 3), index=index, | ||
....: columns=['A', 'B', 'C']) | ||
....: | ||
|
||
In [21]: df | ||
|
@@ -131,7 +126,7 @@ columns, this is equivalent to passing a | |
two -3.207595 -1.535854 0.409769 | ||
three -0.673145 -0.741113 -0.110891 | ||
|
||
In [22]: store.append('mi',df) | ||
In [22]: store.append('mi', df) | ||
|
||
In [23]: store.select('mi') | ||
Out[23]: | ||
|
@@ -162,26 +157,28 @@ combined result, by using ``where`` on a selector table. | |
|
||
.. ipython:: python | ||
|
||
df_mt = DataFrame(randn(8, 6), index=date_range('1/1/2000', periods=8), | ||
columns=['A', 'B', 'C', 'D', 'E', 'F']) | ||
df_mt = pd.DataFrame(np.random.randn(8, 6), | ||
index=pd.date_range('1/1/2000', periods=8), | ||
columns=['A', 'B', 'C', 'D', 'E', 'F']) | ||
df_mt['foo'] = 'bar' | ||
|
||
# you can also create the tables individually | ||
store.append_to_multiple({ 'df1_mt' : ['A','B'], 'df2_mt' : None }, df_mt, selector = 'df1_mt') | ||
store.append_to_multiple({'df1_mt': ['A', 'B'], 'df2_mt': None}, | ||
df_mt, selector='df1_mt') | ||
store | ||
|
||
# indiviual tables were created | ||
store.select('df1_mt') | ||
store.select('df2_mt') | ||
|
||
# as a multiple | ||
store.select_as_multiple(['df1_mt','df2_mt'], where = [ 'A>0','B>0' ], selector = 'df1_mt') | ||
store.select_as_multiple(['df1_mt', 'df2_mt'], where=['A>0', 'B>0'], | ||
selector='df1_mt') | ||
|
||
.. ipython:: python | ||
:suppress: | ||
|
||
store.close() | ||
import os | ||
os.remove('store.h5') | ||
|
||
**Enhancements** | ||
|
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.
do we still need the
{{ header }}
? cc @datapythonistaThere 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.
Yes, it should be in all pages. It is where we do the
import pandas as pd
and set some options. But even in pages where there is no code, I need it there because with the new sphinx theme, I'll be controlling the navigation with this.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.
I added it back. It was a mistake. I deleted with the include block.