Skip to content

Commit 75686eb

Browse files
saurav-chakravortyjreback
authored andcommitted
DOC: flake8 fix for whatsnew v.0.12.* (#24309)
1 parent 6643a97 commit 75686eb

File tree

2 files changed

+21
-24
lines changed

2 files changed

+21
-24
lines changed

doc/source/whatsnew/v0.12.0.rst

+21-23
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ v0.12.0 (July 24, 2013)
55

66
{{ header }}
77

8-
.. ipython:: python
9-
:suppress:
10-
11-
from pandas import * # noqa F401, F403
12-
138

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

5348
.. ipython:: python
5449
55-
p = DataFrame({ 'first' : [4,5,8], 'second' : [0,0,3] })
50+
p = pd.DataFrame({'first': [4, 5, 8], 'second': [0, 0, 3]})
5651
p % 0
5752
p % p
5853
p / p
@@ -66,10 +61,13 @@ API changes
6661

6762
.. ipython:: python
6863
69-
df2 = DataFrame([{"val1": 1, "val2" : 20}, {"val1":1, "val2": 19},
70-
{"val1":1, "val2": 27}, {"val1":1, "val2": 12}])
64+
df2 = pd.DataFrame([{"val1": 1, "val2": 20},
65+
{"val1": 1, "val2": 19},
66+
{"val1": 1, "val2": 27},
67+
{"val1": 1, "val2": 12}])
68+
7169
def func(dataf):
72-
return dataf["val2"] - dataf["val2"].mean()
70+
return dataf["val2"] - dataf["val2"].mean()
7371
7472
# squeezing the result frame to a series (because we have unique groups)
7573
df2.groupby("val1", squeeze=True).apply(func)
@@ -91,8 +89,8 @@ API changes
9189
9290
.. ipython:: python
9391
94-
df = DataFrame(lrange(5), list('ABCDE'), columns=['a'])
95-
mask = (df.a%2 == 0)
92+
df = pd.DataFrame(lrange(5), list('ABCDE'), columns=['a'])
93+
mask = (df.a % 2 == 0)
9694
mask
9795
9896
# this is what you should use
@@ -152,7 +150,7 @@ API changes
152150
.. code-block:: python
153151
154152
from pandas.io.sql import read_frame
155-
read_frame(....)
153+
read_frame(...)
156154
157155
- ``DataFrame.to_html`` and ``DataFrame.to_latex`` now accept a path for
158156
their first argument (:issue:`3702`)
@@ -196,7 +194,7 @@ I/O Enhancements
196194
.. ipython :: python
197195
:okwarning:
198196
199-
df = DataFrame({'a': range(3), 'b': list('abc')})
197+
df = pd.DataFrame({'a': range(3), 'b': list('abc')})
200198
print(df)
201199
html = df.to_html()
202200
alist = pd.read_html(html, index_col=0)
@@ -247,7 +245,7 @@ I/O Enhancements
247245
df = mkdf(5, 3, r_idx_nlevels=2, c_idx_nlevels=4)
248246
df.to_csv('mi.csv')
249247
print(open('mi.csv').read())
250-
pd.read_csv('mi.csv', header=[0,1,2,3], index_col=[0,1])
248+
pd.read_csv('mi.csv', header=[0, 1, 2, 3], index_col=[0, 1])
251249
252250
.. ipython:: python
253251
:suppress:
@@ -264,10 +262,10 @@ I/O Enhancements
264262
265263
In [25]: path = 'store_iterator.h5'
266264
267-
In [26]: DataFrame(randn(10,2)).to_hdf(path,'df',table=True)
265+
In [26]: pd.DataFrame(np.random.randn(10, 2)).to_hdf(path, 'df', table=True)
268266
269-
In [27]: for df in read_hdf(path,'df', chunksize=3):
270-
....: print df
267+
In [27]: for df in pd.read_hdf(path, 'df', chunksize=3):
268+
....: print(df)
271269
....:
272270
0 1
273271
0 0.713216 -0.778461
@@ -300,7 +298,7 @@ Other Enhancements
300298

301299
.. ipython :: python
302300
303-
df = DataFrame({'a': list('ab..'), 'b': [1, 2, 3, 4]})
301+
df = pd.DataFrame({'a': list('ab..'), 'b': [1, 2, 3, 4]})
304302
df.replace(regex=r'\s*\.\s*', value=np.nan)
305303
306304
to replace all occurrences of the string ``'.'`` with zero or more
@@ -342,7 +340,7 @@ Other Enhancements
342340

343341
.. ipython:: python
344342
345-
sf = Series([1, 1, 2, 3, 3, 3])
343+
sf = pd.Series([1, 1, 2, 3, 3, 3])
346344
sf.groupby(sf).filter(lambda x: x.sum() > 2)
347345
348346
The argument of ``filter`` must a function that, applied to the group as a
@@ -353,7 +351,7 @@ Other Enhancements
353351

354352
.. ipython:: python
355353
356-
dff = DataFrame({'A': np.arange(8), 'B': list('aabbbbcc')})
354+
dff = pd.DataFrame({'A': np.arange(8), 'B': list('aabbbbcc')})
357355
dff.groupby('B').filter(lambda x: len(x) > 2)
358356
359357
Alternatively, instead of dropping the offending groups, we can return a
@@ -400,8 +398,8 @@ Experimental Features
400398
bday_egypt = CustomBusinessDay(holidays=holidays, weekmask=weekmask_egypt)
401399
dt = datetime(2013, 4, 30)
402400
print(dt + 2 * bday_egypt)
403-
dts = date_range(dt, periods=5, freq=bday_egypt)
404-
print(Series(dts.weekday, dts).map(Series('Mon Tue Wed Thu Fri Sat Sun'.split())))
401+
dts = pd.date_range(dt, periods=5, freq=bday_egypt)
402+
print(pd.Series(dts.weekday, dts).map(pd.Series('Mon Tue Wed Thu Fri Sat Sun'.split())))
405403
406404
Bug Fixes
407405
~~~~~~~~~
@@ -424,7 +422,7 @@ Bug Fixes
424422
.. ipython:: python
425423
426424
strs = 'go', 'bow', 'joe', 'slow'
427-
ds = Series(strs)
425+
ds = pd.Series(strs)
428426
429427
for s in ds.str:
430428
print(s)

setup.cfg

-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ ignore = E402, # module level import not at top of file
4545
E703, # statement ends with a semicolon
4646

4747
exclude =
48-
doc/source/whatsnew/v0.12.0.rst
4948
doc/source/whatsnew/v0.13.0.rst
5049
doc/source/whatsnew/v0.13.1.rst
5150
doc/source/whatsnew/v0.15.0.rst

0 commit comments

Comments
 (0)