Skip to content

DOC: flake8 fix for whatsnew v.0.12.* #24309

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 2 commits into from
Dec 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
44 changes: 21 additions & 23 deletions doc/source/whatsnew/v0.12.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ v0.12.0 (July 24, 2013)

{{ header }}

.. ipython:: python
:suppress:

from pandas import * # noqa F401, F403


This is a major release from 0.11.0 and includes several new features and
enhancements along with a large number of bug fixes.
Expand Down Expand Up @@ -52,7 +47,7 @@ API changes

.. ipython:: python

p = DataFrame({ 'first' : [4,5,8], 'second' : [0,0,3] })
p = pd.DataFrame({'first': [4, 5, 8], 'second': [0, 0, 3]})
p % 0
p % p
p / p
Expand All @@ -66,10 +61,13 @@ API changes

.. ipython:: python

df2 = DataFrame([{"val1": 1, "val2" : 20}, {"val1":1, "val2": 19},
{"val1":1, "val2": 27}, {"val1":1, "val2": 12}])
df2 = pd.DataFrame([{"val1": 1, "val2": 20},
{"val1": 1, "val2": 19},
{"val1": 1, "val2": 27},
{"val1": 1, "val2": 12}])

def func(dataf):
return dataf["val2"] - dataf["val2"].mean()
return dataf["val2"] - dataf["val2"].mean()

# squeezing the result frame to a series (because we have unique groups)
df2.groupby("val1", squeeze=True).apply(func)
Expand All @@ -91,8 +89,8 @@ API changes

.. ipython:: python

df = DataFrame(lrange(5), list('ABCDE'), columns=['a'])
mask = (df.a%2 == 0)
df = pd.DataFrame(lrange(5), list('ABCDE'), columns=['a'])
mask = (df.a % 2 == 0)
mask

# this is what you should use
Expand Down Expand Up @@ -152,7 +150,7 @@ API changes
.. code-block:: python

from pandas.io.sql import read_frame
read_frame(....)
read_frame(...)

- ``DataFrame.to_html`` and ``DataFrame.to_latex`` now accept a path for
their first argument (:issue:`3702`)
Expand Down Expand Up @@ -196,7 +194,7 @@ I/O Enhancements
.. ipython :: python
:okwarning:

df = DataFrame({'a': range(3), 'b': list('abc')})
df = pd.DataFrame({'a': range(3), 'b': list('abc')})
print(df)
html = df.to_html()
alist = pd.read_html(html, index_col=0)
Expand Down Expand Up @@ -247,7 +245,7 @@ I/O Enhancements
df = mkdf(5, 3, r_idx_nlevels=2, c_idx_nlevels=4)
df.to_csv('mi.csv')
print(open('mi.csv').read())
pd.read_csv('mi.csv', header=[0,1,2,3], index_col=[0,1])
pd.read_csv('mi.csv', header=[0, 1, 2, 3], index_col=[0, 1])

.. ipython:: python
:suppress:
Expand All @@ -264,10 +262,10 @@ I/O Enhancements

In [25]: path = 'store_iterator.h5'

In [26]: DataFrame(randn(10,2)).to_hdf(path,'df',table=True)
In [26]: pd.DataFrame(np.random.randn(10, 2)).to_hdf(path, 'df', table=True)

In [27]: for df in read_hdf(path,'df', chunksize=3):
....: print df
In [27]: for df in pd.read_hdf(path, 'df', chunksize=3):
....: print(df)
....:
0 1
0 0.713216 -0.778461
Expand Down Expand Up @@ -300,7 +298,7 @@ Other Enhancements

.. ipython :: python

df = DataFrame({'a': list('ab..'), 'b': [1, 2, 3, 4]})
df = pd.DataFrame({'a': list('ab..'), 'b': [1, 2, 3, 4]})
df.replace(regex=r'\s*\.\s*', value=np.nan)

to replace all occurrences of the string ``'.'`` with zero or more
Expand Down Expand Up @@ -342,7 +340,7 @@ Other Enhancements

.. ipython:: python

sf = Series([1, 1, 2, 3, 3, 3])
sf = pd.Series([1, 1, 2, 3, 3, 3])
sf.groupby(sf).filter(lambda x: x.sum() > 2)

The argument of ``filter`` must a function that, applied to the group as a
Expand All @@ -353,7 +351,7 @@ Other Enhancements

.. ipython:: python

dff = DataFrame({'A': np.arange(8), 'B': list('aabbbbcc')})
dff = pd.DataFrame({'A': np.arange(8), 'B': list('aabbbbcc')})
dff.groupby('B').filter(lambda x: len(x) > 2)

Alternatively, instead of dropping the offending groups, we can return a
Expand Down Expand Up @@ -400,8 +398,8 @@ Experimental Features
bday_egypt = CustomBusinessDay(holidays=holidays, weekmask=weekmask_egypt)
dt = datetime(2013, 4, 30)
print(dt + 2 * bday_egypt)
dts = date_range(dt, periods=5, freq=bday_egypt)
print(Series(dts.weekday, dts).map(Series('Mon Tue Wed Thu Fri Sat Sun'.split())))
dts = pd.date_range(dt, periods=5, freq=bday_egypt)
print(pd.Series(dts.weekday, dts).map(pd.Series('Mon Tue Wed Thu Fri Sat Sun'.split())))

Bug Fixes
~~~~~~~~~
Expand All @@ -424,7 +422,7 @@ Bug Fixes
.. ipython:: python

strs = 'go', 'bow', 'joe', 'slow'
ds = Series(strs)
ds = pd.Series(strs)

for s in ds.str:
print(s)
Expand Down
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ ignore = E402, # module level import not at top of file
E703, # statement ends with a semicolon

exclude =
doc/source/whatsnew/v0.12.0.rst
doc/source/whatsnew/v0.13.0.rst
doc/source/whatsnew/v0.13.1.rst
doc/source/whatsnew/v0.15.0.rst
Expand Down