Skip to content

Commit ac3cdab

Browse files
committed
DOC: whatsnew updates
1 parent 43a0102 commit ac3cdab

File tree

2 files changed

+25
-19
lines changed

2 files changed

+25
-19
lines changed

doc/source/v0.11.0.txt

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ API changes
1313

1414
Numeric dtypes will propagate and can coexist in DataFrames. If a dtype is passed (either directly via the ``dtype`` keyword, a passed ``ndarray``, or a passed ``Series``, then it will be preserved in DataFrame operations. Furthermore, different numeric dtypes will **NOT** be combined. The following example will give you a taste.
1515

16-
**Dtype Specification**
16+
Dtype Specification
17+
~~~~~~~~~~~~~~~~~~~
1718

1819
.. ipython:: python
1920

@@ -29,7 +30,8 @@ Numeric dtypes will propagate and can coexist in DataFrames. If a dtype is passe
2930
df3
3031
df3.dtypes
3132

32-
**Dtype conversion**
33+
Dtype Conversion
34+
~~~~~~~~~~~~~~~~
3335

3436
.. ipython:: python
3537

@@ -54,20 +56,22 @@ Numeric dtypes will propagate and can coexist in DataFrames. If a dtype is passe
5456
Timestamp('20010104'), '20010105'],dtype='O')
5557
s.convert_objects(convert_dates='coerce')
5658

59+
Dtype Gotchas
60+
~~~~~~~~~~~~~
5761

5862
**Platform Gotchas**
5963

6064
Starting in 0.11.0, construction of DataFrame/Series will use default dtypes of ``int64`` and ``float64``,
6165
*regardless of platform*. This is not an apparent change from earlier versions of pandas. If you specify
62-
dtypes, they *WILL* be respected, however.
66+
dtypes, they *WILL* be respected, however (GH2837_)
6367

6468
The following will all result in ``int64`` dtypes
6569

6670
.. ipython:: python
6771

6872
DataFrame([1,2],columns=['a']).dtypes
69-
DataFrame({'a' : [1,2] }.dtypes
70-
DataFrame({'a' : 1).dtypes
73+
DataFrame({'a' : [1,2] }).dtypes
74+
DataFrame({'a' : 1 }, index=range(2)).dtypes
7175

7276
Keep in mind that ``DataFrame(np.array([1,2]))`` **WILL** result in ``int32`` on 32-bit platforms!
7377

@@ -100,11 +104,13 @@ While float dtypes are unchanged.
100104
casted
101105
casted.dtypes
102106

103-
**Datetimes conversion**
107+
Datetimes Conversion
108+
~~~~~~~~~~~~~~~~~~~~
104109

105110
Datetime64[ns] columns in a DataFrame (or a Series) allow the use of ``np.nan`` to indicate a nan value,
106111
in addition to the traditional ``NaT``, or not-a-time. This allows convenient nan setting in a generic way.
107112
Furthermore ``datetime64[ns]`` columns are created by default, when passed datetimelike objects (*this change was introduced in 0.10.1*)
113+
(GH2809_, GH2810_)
108114

109115
.. ipython:: python
110116

@@ -139,23 +145,27 @@ New features
139145

140146
**Enhancements**
141147

142-
- In ``HDFStore``, provide dotted attribute access to ``get`` from stores (e.g. store.df == store['df'])
148+
- In ``HDFStore``, provide dotted attribute access to ``get`` from stores
149+
(e.g. store.df == store['df'])
143150

144-
``Squeeze`` to possibly remove length 1 dimensions from an object.
151+
- ``Squeeze`` to possibly remove length 1 dimensions from an object.
145152

146-
.. ipython:: python
153+
.. ipython:: python
147154

148-
p = Panel(randn(3,4,4),items=['ItemA','ItemB','ItemC'],
155+
p = Panel(randn(3,4,4),items=['ItemA','ItemB','ItemC'],
149156
major_axis=date_range('20010102',periods=4),
150157
minor_axis=['A','B','C','D'])
151-
p
152-
p.reindex(items=['ItemA']).squeeze()
153-
p.reindex(items=['ItemA'],minor=['B']).squeeze()
158+
p
159+
p.reindex(items=['ItemA']).squeeze()
160+
p.reindex(items=['ItemA'],minor=['B']).squeeze()
154161

155162
**Bug Fixes**
156163

157164
See the `full release notes
158165
<https://github.com/pydata/pandas/blob/master/RELEASE.rst>`__ or issue tracker
159166
on GitHub for a complete list.
160167

168+
.. _GH2809: https://github.com/pydata/pandas/issues/2809
169+
.. _GH2810: https://github.com/pydata/pandas/issues/2810
170+
.. _GH2837: https://github.com/pydata/pandas/issues/2837
161171

pandas/tests/test_frame.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2903,12 +2903,8 @@ def _check_cast(df, v):
29032903
casted = mn.astype('float32')
29042904
_check_cast(casted, 'float32')
29052905

2906-
# this is platform dependent overflow
2907-
if np.int_ == np.int32:
2908-
self.assertRaises(OverflowError, mn.astype, 'int32')
2909-
else:
2910-
casted = mn.astype('int32')
2911-
_check_cast(casted, 'int32')
2906+
casted = mn.astype('int32')
2907+
_check_cast(casted, 'int32')
29122908

29132909
# to object
29142910
casted = mn.astype('O')

0 commit comments

Comments
 (0)