Skip to content

Commit 7074eb8

Browse files
saurav-chakravortyPingviinituutti
authored andcommitted
DOC: FIx flake8 errors for whatsnew v0.7.* -v0.9.* rst (pandas-dev#24273)
1 parent b7aad64 commit 7074eb8

File tree

9 files changed

+40
-79
lines changed

9 files changed

+40
-79
lines changed

doc/source/whatsnew/v0.7.0.rst

+6-11
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ v.0.7.0 (February 9, 2012)
55

66
{{ header }}
77

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

149
New features
1510
~~~~~~~~~~~~
@@ -38,7 +33,7 @@ New features
3833

3934
.. ipython:: python
4035
41-
df = DataFrame(randn(10, 4))
36+
df = pd.DataFrame(np.random.randn(10, 4))
4237
df.apply(lambda x: x.describe())
4338
4439
- :ref:`Add<advanced.reorderlevels>` ``reorder_levels`` method to Series and
@@ -123,7 +118,7 @@ regard to label-based indexing. Here is an example:
123118

124119
.. ipython:: python
125120
126-
s = Series(randn(10), index=range(0, 20, 2))
121+
s = pd.Series(np.random.randn(10), index=range(0, 20, 2))
127122
s
128123
s[0]
129124
s[2]
@@ -142,7 +137,7 @@ This change also has the same impact on DataFrame:
142137

143138
.. code-block:: ipython
144139
145-
In [3]: df = DataFrame(randn(8, 4), index=range(0, 16, 2))
140+
In [3]: df = pd.DataFrame(np.random.randn(8, 4), index=range(0, 16, 2))
146141
147142
In [4]: df
148143
0 1 2 3
@@ -179,7 +174,7 @@ Label-based slicing using ``ix`` now requires that the index be sorted
179174

180175
.. code-block:: python
181176
182-
In [1]: s = Series(randn(6), index=list('gmkaec'))
177+
In [1]: s = pd.Series(np.random.randn(6), index=list('gmkaec'))
183178
184179
In [2]: s
185180
Out[2]:
@@ -242,7 +237,7 @@ passing similar input to ``ix`` **except in the case of integer indexing**:
242237

243238
.. ipython:: python
244239
245-
s = Series(randn(6), index=list('acegkm'))
240+
s = pd.Series(np.random.randn(6), index=list('acegkm'))
246241
s
247242
s[['m', 'a', 'c', 'e']]
248243
s['b':'l']
@@ -253,7 +248,7 @@ In the case of integer indexes, the behavior will be exactly as before
253248

254249
.. ipython:: python
255250
256-
s = Series(randn(6), index=range(0, 12, 2))
251+
s = pd.Series(np.random.randn(6), index=range(0, 12, 2))
257252
s[[4, 0, 2]]
258253
s[1:5]
259254

doc/source/whatsnew/v0.7.1.rst

-5
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ v.0.7.1 (February 29, 2012)
55

66
{{ header }}
77

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

149
This release includes a few new features and addresses over a dozen bugs in
1510
0.7.0.

doc/source/whatsnew/v0.7.2.rst

-5
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ v.0.7.2 (March 16, 2012)
55

66
{{ header }}
77

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

149
This release targets bugs in 0.7.1, and adds a few minor features.
1510

doc/source/whatsnew/v0.7.3.rst

+10-15
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ v.0.7.3 (April 12, 2012)
55

66
{{ header }}
77

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

149
This is a minor release from 0.7.2 and fixes many minor bugs and adds a number
1510
of nice new features. There are also a couple of API changes to note; these
@@ -28,7 +23,7 @@ New features
2823
.. code-block:: python
2924
3025
from pandas.tools.plotting import scatter_matrix
31-
scatter_matrix(df, alpha=0.2)
26+
scatter_matrix(df, alpha=0.2) # noqa F821
3227
3328
.. image:: ../savefig/scatter_matrix_kde.png
3429
:width: 5in
@@ -38,14 +33,14 @@ New features
3833

3934
.. code-block:: python
4035
41-
df.plot(kind='bar', stacked=True)
36+
df.plot(kind='bar', stacked=True) # noqa F821
4237
4338
.. image:: ../savefig/bar_plot_stacked_ex.png
4439
:width: 4in
4540

4641
.. code-block:: python
4742
48-
df.plot(kind='barh', stacked=True)
43+
df.plot(kind='barh', stacked=True) # noqa F821
4944
5045
.. image:: ../savefig/barh_plot_stacked_ex.png
5146
:width: 4in
@@ -63,7 +58,7 @@ Reverted some changes to how NA values (represented typically as ``NaN`` or
6358

6459
.. ipython:: python
6560
66-
series = Series(['Steve', np.nan, 'Joe'])
61+
series = pd.Series(['Steve', np.nan, 'Joe'])
6762
series == 'Steve'
6863
series != 'Steve'
6964
@@ -93,15 +88,15 @@ Series, to be more consistent with the ``groupby`` behavior with DataFrame:
9388
.. ipython:: python
9489
:okwarning:
9590
96-
df = DataFrame({'A' : ['foo', 'bar', 'foo', 'bar',
97-
'foo', 'bar', 'foo', 'foo'],
98-
'B' : ['one', 'one', 'two', 'three',
99-
'two', 'two', 'one', 'three'],
100-
'C' : np.random.randn(8), 'D' : np.random.randn(8)})
91+
df = pd.DataFrame({'A': ['foo', 'bar', 'foo', 'bar',
92+
'foo', 'bar', 'foo', 'foo'],
93+
'B': ['one', 'one', 'two', 'three',
94+
'two', 'two', 'one', 'three'],
95+
'C': np.random.randn(8), 'D': np.random.randn(8)})
10196
df
10297
grouped = df.groupby('A')['C']
10398
grouped.describe()
104-
grouped.apply(lambda x: x.sort_values()[-2:]) # top 2 values
99+
grouped.apply(lambda x: x.sort_values()[-2:]) # top 2 values
105100
106101
107102
.. _whatsnew_0.7.3.contributors:

doc/source/whatsnew/v0.8.0.rst

+4-9
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ v0.8.0 (June 29, 2012)
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.7.3 and includes extensive work on the time
1510
series handling and processing infrastructure as well as a great deal of new
@@ -183,8 +178,8 @@ types. For example, ``'kde'`` is a new option:
183178

184179
.. ipython:: python
185180
186-
s = Series(np.concatenate((np.random.randn(1000),
187-
np.random.randn(1000) * 0.5 + 3)))
181+
s = pd.Series(np.concatenate((np.random.randn(1000),
182+
np.random.randn(1000) * 0.5 + 3)))
188183
plt.figure()
189184
s.hist(density=True, alpha=0.2)
190185
s.plot(kind='kde')
@@ -211,7 +206,7 @@ with code using scalar values because you are handing control over to NumPy:
211206
.. ipython:: python
212207
213208
import datetime
214-
rng = date_range('1/1/2000', periods=10)
209+
rng = pd.date_range('1/1/2000', periods=10)
215210
rng[5]
216211
isinstance(rng[5], datetime.datetime)
217212
rng_asarray = np.asarray(rng)
@@ -257,7 +252,7 @@ type. See `matplotlib documentation
257252

258253
.. ipython:: python
259254
260-
rng = date_range('1/1/2000', periods=10)
255+
rng = pd.date_range('1/1/2000', periods=10)
261256
rng
262257
np.asarray(rng)
263258
converted = np.asarray(rng, dtype=object)

doc/source/whatsnew/v0.8.1.rst

-5
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ v0.8.1 (July 22, 2012)
55

66
{{ header }}
77

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

149
This release includes a few new features, performance enhancements, and over 30
1510
bug fixes from 0.8.0. New features include notably NA friendly string

doc/source/whatsnew/v0.9.0.rst

+8-9
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22

33
{{ header }}
44

5-
.. ipython:: python
6-
:suppress:
7-
8-
from pandas import * # noqa F401, F403
9-
105

116
v0.9.0 (October 7, 2012)
127
------------------------
@@ -44,8 +39,12 @@ API changes
4439

4540
.. ipython:: python
4641
47-
data = '0,0,1\n1,1,0\n0,1,0'
48-
df = read_csv(StringIO(data), header=None)
42+
import io
43+
44+
data = ('0,0,1\n'
45+
'1,1,0\n'
46+
'0,1,0')
47+
df = pd.read_csv(io.StringIO(data), header=None)
4948
df
5049
5150
@@ -57,10 +56,10 @@ API changes
5756

5857
.. ipython:: python
5958
60-
s1 = Series([1, 2, 3])
59+
s1 = pd.Series([1, 2, 3])
6160
s1
6261
63-
s2 = Series(s1, index=['foo', 'bar', 'baz'])
62+
s2 = pd.Series(s1, index=['foo', 'bar', 'baz'])
6463
s2
6564
6665
- Deprecated ``day_of_year`` API removed from PeriodIndex, use ``dayofyear``

doc/source/whatsnew/v0.9.1.rst

+12-13
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ v0.9.1 (November 14, 2012)
55

66
{{ header }}
77

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

149
This is a bug fix release from 0.9.0 and includes several new features and
1510
enhancements along with a large number of bug fixes. The new features include
@@ -25,7 +20,8 @@ New features
2520

2621
.. code-block:: ipython
2722
28-
In [2]: df = DataFrame(np.random.randint(0, 2, (6, 3)), columns=['A', 'B', 'C'])
23+
In [2]: df = pd.DataFrame(np.random.randint(0, 2, (6, 3)),
24+
...: columns=['A', 'B', 'C'])
2925
3026
In [3]: df.sort(['A', 'B'], ascending=[1, 0])
3127
@@ -44,7 +40,7 @@ New features
4440

4541
.. ipython:: python
4642
47-
df = DataFrame(np.random.randn(6, 3), columns=['A', 'B', 'C'])
43+
df = pd.DataFrame(np.random.randn(6, 3), columns=['A', 'B', 'C'])
4844
4945
df.loc[2:4] = np.nan
5046
@@ -101,7 +97,7 @@ New features
10197

10298
.. ipython:: python
10399
104-
xl = ExcelFile('data/test.xls')
100+
xl = pd.ExcelFile('data/test.xls')
105101
xl.parse('Sheet1', index_col=0, parse_dates=True,
106102
parse_cols='A:D')
107103
@@ -124,9 +120,9 @@ API changes
124120

125121
.. code-block:: ipython
126122
127-
In [1]: prng = period_range('2012Q1', periods=2, freq='Q')
123+
In [1]: prng = pd.period_range('2012Q1', periods=2, freq='Q')
128124
129-
In [2]: s = Series(np.random.randn(len(prng)), prng)
125+
In [2]: s = pd.Series(np.random.randn(len(prng)), prng)
130126
131127
In [4]: s.resample('M')
132128
Out[4]:
@@ -143,7 +139,7 @@ API changes
143139

144140
.. ipython:: python
145141
146-
p = Period('2012')
142+
p = pd.Period('2012')
147143
148144
p.end_time
149145
@@ -153,9 +149,12 @@ API changes
153149

154150
.. ipython:: python
155151
156-
data = 'A,B,C\n00001,001,5\n00002,002,6'
152+
import io
157153
158-
read_csv(StringIO(data), converters={'A' : lambda x: x.strip()})
154+
data = ('A,B,C\n'
155+
'00001,001,5\n'
156+
'00002,002,6')
157+
pd.read_csv(io.StringIO(data), converters={'A': lambda x: x.strip()})
159158
160159
161160
See the :ref:`full release notes

setup.cfg

-7
Original file line numberDiff line numberDiff line change
@@ -45,11 +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.7.0.rst
49-
doc/source/whatsnew/v0.7.3.rst
50-
doc/source/whatsnew/v0.8.0.rst
51-
doc/source/whatsnew/v0.9.0.rst
52-
doc/source/whatsnew/v0.9.1.rst
5348
doc/source/whatsnew/v0.12.0.rst
5449
doc/source/whatsnew/v0.13.0.rst
5550
doc/source/whatsnew/v0.13.1.rst
@@ -63,8 +58,6 @@ exclude =
6358
doc/source/whatsnew/v0.17.1.rst
6459
doc/source/whatsnew/v0.18.0.rst
6560
doc/source/whatsnew/v0.18.1.rst
66-
doc/source/whatsnew/v0.23.1.rst
67-
doc/source/whatsnew/v0.23.2.rst
6861
doc/source/basics.rst
6962
doc/source/contributing_docstring.rst
7063
doc/source/enhancingperf.rst

0 commit comments

Comments
 (0)