Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
80 changes: 41 additions & 39 deletions doc/source/whatsnew/v0.15.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ v0.15.0 (October 18, 2014)

.. ipython:: python
:suppress:

from pandas import * # noqa F401, F403
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we want to delete this whole block, that's one of the main points of the issue (see the description)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to be sure, you want me to remove the whole ipython block, am i right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, you can see a similar case here: https://github.com/pandas-dev/pandas/pull/24236/files




Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this blank line is unnecessary, and it should break the validation

This is a major release from 0.14.1 and includes a small number of API changes, several new features,
enhancements, and performance improvements along with a large number of bug fixes. We recommend that all
users upgrade to this version.
Expand Down Expand Up @@ -77,7 +78,7 @@ For full docs, see the :ref:`categorical introduction <categorical>` and the
.. ipython:: python
:okwarning:

df = DataFrame({"id":[1,2,3,4,5,6], "raw_grade":['a', 'b', 'b', 'a', 'a', 'e']})
df = DataFrame({"id": [1, 2, 3, 4, 5, 6], "raw_grade": ['a', 'b', 'b', 'a', 'a', 'e']})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the line too long you mention in the description? You can fix it by simply:

df = DataFrame({"id": [1, 2, 3, 4, 5, 6], "raw_grade": ['a', 'b', 'b', 'a', 'a', 'e']}) 

Or something similar, if you need to do it somewhere else too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried this,but it led to more pep8 errors.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the block is a code-block, you may need to add ... to the beginning of the continuation file. If you can't get it fixed yourself, leave it the way you think it's correct in the PR, so we can review it, and also see the errors in the CI.


df["grade"] = df["raw_grade"].astype("category")
df["grade"]
Expand Down Expand Up @@ -181,22 +182,22 @@ Construct a ``TimedeltaIndex``

.. ipython:: python

TimedeltaIndex(['1 days','1 days, 00:00:05',
np.timedelta64(2,'D'),timedelta(days=2,seconds=2)])
TimedeltaIndex(['1 days', '1 days, 00:00:05',
np.timedelta64(2, 'D'), timedelta(days=2, seconds=2)])

Constructing a ``TimedeltaIndex`` with a regular range

.. ipython:: python

timedelta_range('1 days',periods=5,freq='D')
timedelta_range(start='1 days',end='2 days',freq='30T')
timedelta_range('1 days', periods=5, freq='D')
timedelta_range(start='1 days', end='2 days', freq='30T')

You can now use a ``TimedeltaIndex`` as the index of a pandas object

.. ipython:: python

s = Series(np.arange(5),
index=timedelta_range('1 days',periods=5,freq='s'))
index=timedelta_range('1 days', periods=5, freq='s'))
s

You can select with partial string selections
Expand All @@ -210,9 +211,9 @@ Finally, the combination of ``TimedeltaIndex`` with ``DatetimeIndex`` allow cert

.. ipython:: python

tdi = TimedeltaIndex(['1 days',pd.NaT,'2 days'])
tdi = TimedeltaIndex(['1 days', pd.NaT, '2 days'])
tdi.tolist()
dti = date_range('20130101',periods=3)
dti = date_range('20130101', periods=3)
dti.tolist()

(dti + tdi).tolist()
Expand All @@ -235,7 +236,7 @@ A new display option ``display.memory_usage`` (see :ref:`options`) sets the defa
dtypes = ['int64', 'float64', 'datetime64[ns]', 'timedelta64[ns]',
'complex128', 'object', 'bool']
n = 5000
data = dict([ (t, np.random.randint(100, size=n).astype(t))
data = dict([(t, np.random.randint(100, size=n).astype(t))
for t in dtypes])
df = DataFrame(data)
df['categorical'] = df['object'].astype('category')
Expand All @@ -260,7 +261,7 @@ This will return a Series, indexed like the existing Series. See the :ref:`docs
.. ipython:: python
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you revert this change? (there needs to be a blank line between the last sentence and .. ipython::)


# datetime
s = Series(date_range('20130101 09:10:12',periods=4))
s = Series(date_range('20130101 09:10:12', periods=4))
s
s.dt.hour
s.dt.second
Expand Down Expand Up @@ -292,15 +293,15 @@ The ``.dt`` accessor works for period and timedelta dtypes.
.. ipython:: python

# period
s = Series(period_range('20130101',periods=4,freq='D'))
s = Series(period_range('20130101', periods=4, freq='D'))
s
s.dt.year
s.dt.day

.. ipython:: python

# timedelta
s = Series(timedelta_range('1 day 00:00:05',periods=4,freq='s'))
s = Series(timedelta_range('1 day 00:00:05', periods=4, freq='s'))
s
s.dt.days
s.dt.seconds
Expand Down Expand Up @@ -667,7 +668,7 @@ Other notable API changes:

.. ipython:: python

df = DataFrame([['a'],['b']],index=[1,2])
df = DataFrame([['a'], ['b']], index=[1, 2])
df

In prior versions there was a difference in these two constructs:
Expand All @@ -686,13 +687,13 @@ Other notable API changes:

.. code-block:: ipython

In [3]: df.loc[[1,3]]
In [3]: df.loc[[1, 3]]
Out[3]:
0
1 a
3 NaN

In [4]: df.loc[[1,3],:]
In [4]: df.loc[[1, 3], :]
Out[4]:
0
1 a
Expand All @@ -702,10 +703,10 @@ Other notable API changes:

.. ipython:: python

p = Panel(np.arange(2*3*4).reshape(2,3,4),
items=['ItemA','ItemB'],
major_axis=[1,2,3],
minor_axis=['A','B','C','D'])
p = Panel(np.arange(2 * 3 * 4).reshape(2, 3, 4),
items=['ItemA', 'ItemB'],
major_axis=[1, 2, 3],
minor_axis=['A', 'B', 'C', 'D'])
p

The following would raise ``KeyError`` prior to 0.15.0:
Expand All @@ -724,15 +725,15 @@ Other notable API changes:
.. ipython:: python
:okexcept:

s = Series(np.arange(3,dtype='int64'),
index=MultiIndex.from_product([['A'],['foo','bar','baz']],
names=['one','two'])
).sort_index()
s = Series(np.arange(3, dtype='int64'),
index=MultiIndex.from_product([['A'], ['foo', 'bar', 'baz']],
names=['one', 'two'])
).sort_index()
s
try:
s.loc[['D']]
s.loc[['D']]
except KeyError as e:
print("KeyError: " + str(e))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add back this print statement?

print("KeyError: " + str(e))

- Assigning values to ``None`` now considers the dtype when choosing an 'empty' value (:issue:`7941`).

Expand Down Expand Up @@ -815,9 +816,9 @@ Other notable API changes:

.. ipython:: python

i = date_range('1/1/2011', periods=3, freq='10s', tz = 'US/Eastern')
i = date_range('1/1/2011', periods=3, freq='10s', tz='US/Eastern')
i
df = DataFrame( {'a' : i } )
df = DataFrame({'a': i})
df
df.dtypes

Expand All @@ -836,7 +837,7 @@ Other notable API changes:

.. code-block:: python
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This indentation is wrong, should be at the top level. And this should be a .. code-block:: ipython (ipython instead of python.

See similar examples for the exact format.


In [1]: df = DataFrame(np.arange(0,9), columns=['count'])
In [1]: df = DataFrame(np.arange(0, 9), columns=['count'])

In [2]: df['group'] = 'b'

Expand All @@ -854,8 +855,8 @@ Other notable API changes:

.. ipython:: python

df = DataFrame([[True, 1],[False, 2]],
columns=["female","fitness"])
df = DataFrame([[True, 1], [False, 2]],
columns=["female", "fitness"])
df
df.dtypes

Expand Down Expand Up @@ -915,18 +916,18 @@ Deprecations
.. code-block:: python

# +
Index(['a','b','c']) + Index(['b','c','d'])
Index(['a', 'b', 'c']) + Index(['b', 'c', 'd'])

# should be replaced by
Index(['a','b','c']).union(Index(['b','c','d']))
Index(['a', 'b', 'c']).union(Index(['b', 'c', 'd']))

.. code-block:: python

# -
Index(['a','b','c']) - Index(['b','c','d'])
Index(['a', 'b', 'c']) - Index(['b', 'c', 'd'])

# should be replaced by
Index(['a','b','c']).difference(Index(['b','c','d']))
Index(['a', 'b', 'c']).difference(Index(['b', 'c', 'd']))

- The ``infer_types`` argument to :func:`~pandas.read_html` now has no
effect and is deprecated (:issue:`7762`, :issue:`7032`).
Expand Down Expand Up @@ -1050,11 +1051,12 @@ Other:

.. ipython:: python

idx = MultiIndex.from_product([['a'], range(3), list("pqr")], names=['foo', 'bar', 'baz'])
idx = MultiIndex.from_product(
[['a'], range(3), list("pqr")], names=['foo', 'bar', 'baz'])
idx.set_names('qux', level=0)
idx.set_names(['qux','corge'], level=[0,1])
idx.set_levels(['a','b','c'], level='bar')
idx.set_levels([['a','b','c'],[1,2,3]], level=[1,2])
idx.set_names(['qux', 'corge'], level=[0, 1])
idx.set_levels(['a', 'b', 'c'], level='bar')
idx.set_levels([['a', 'b', 'c'], [1, 2, 3]], level=[1, 2])

- ``Index.isin`` now supports a ``level`` argument to specify which index level
to use for membership tests (:issue:`7892`, :issue:`7890`)
Expand Down
10 changes: 5 additions & 5 deletions doc/source/whatsnew/v0.15.1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ API changes

.. ipython:: python

s = Series(date_range('20130101',periods=5,freq='D'))
s = Series(date_range('20130101', periods=5, freq='D'))
s.iloc[2] = np.nan
s

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you try to redefine df and ts before line 64 (can't comment there, as it's not edited in the PR)

I think they should be accessible from the previous block. You can also use # noqa F821 in the failing line, to stop the error from being raised.

Expand Down Expand Up @@ -156,9 +156,9 @@ API changes

In [17]: from pandas.io.data import Options

In [18]: aapl = Options('aapl','yahoo')
In [18]: aapl = Options('aapl', 'yahoo')

In [19]: aapl.get_call_data().iloc[0:5,0:1]
In [19]: aapl.get_call_data().iloc[0:5, 0:1]
Out[19]:
Last
Strike Expiry Type Symbol
Expand All @@ -183,7 +183,7 @@ API changes
datetime.date(2016, 1, 15),
datetime.date(2017, 1, 20)]

In [21]: aapl.get_near_stock_price(expiry=aapl.expiry_dates[0:3]).iloc[0:5,0:1]
In [21]: aapl.get_near_stock_price(expiry=aapl.expiry_dates[0:3]).iloc[0:5, 0:1]
Out[21]:
Last
Strike Expiry Type Symbol
Expand Down Expand Up @@ -233,7 +233,7 @@ Enhancements

.. ipython:: python

dfi = DataFrame(1,index=pd.MultiIndex.from_product([['a'],range(1000)]),columns=['A'])
dfi = DataFrame(1, index=pd.MultiIndex.from_product([['a'], range(1000)]), columns=['A'])

previous behavior:

Expand Down
2 changes: 1 addition & 1 deletion doc/source/whatsnew/v0.15.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ API changes

.. ipython:: python

data = pd.DataFrame({'x':[1, 2, 3]})
data = pd.DataFrame({'x': [1, 2, 3]})
data.y = 2
data['y'] = [2, 4, 6]
data
Expand Down
Binary file added doc/test.parquet
Binary file not shown.