Skip to content

Commit

Permalink
DOC: further clean-up null/na changes (pandas-dev#17113)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisvandenbossche authored and alanbato committed Nov 10, 2017
1 parent 4b78b90 commit 2537cfe
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 19 deletions.
4 changes: 2 additions & 2 deletions doc/source/basics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ optional ``level`` parameter which applies only if the object has a
:header: "Function", "Description"
:widths: 20, 80

``count``, Number of non-na observations
``count``, Number of non-NA observations
``sum``, Sum of values
``mean``, Mean of values
``mad``, Mean absolute deviation
Expand Down Expand Up @@ -541,7 +541,7 @@ will exclude NAs on Series input by default:
np.mean(df['one'].values)
``Series`` also has a method :meth:`~Series.nunique` which will return the
number of unique non-na values:
number of unique non-NA values:

.. ipython:: python
Expand Down
5 changes: 0 additions & 5 deletions doc/source/io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ usecols : array-like or callable, default ``None``
Using this parameter results in much faster parsing time and lower memory usage.
as_recarray : boolean, default ``False``

.. deprecated:: 0.18.2

Please call ``pd.read_csv(...).to_records()`` instead.
Expand Down Expand Up @@ -193,7 +192,6 @@ skiprows : list-like or integer, default ``None``
skipfooter : int, default ``0``
Number of lines at bottom of file to skip (unsupported with engine='c').
skip_footer : int, default ``0``

.. deprecated:: 0.19.0

Use the ``skipfooter`` parameter instead, as they are identical
Expand All @@ -208,13 +206,11 @@ low_memory : boolean, default ``True``
use the ``chunksize`` or ``iterator`` parameter to return the data in chunks.
(Only valid with C parser)
buffer_lines : int, default None

.. deprecated:: 0.19.0

Argument removed because its value is not respected by the parser

compact_ints : boolean, default False

.. deprecated:: 0.19.0

Argument moved to ``pd.to_numeric``
Expand All @@ -223,7 +219,6 @@ compact_ints : boolean, default False
parser will attempt to cast it as the smallest integer ``dtype`` possible, either
signed or unsigned depending on the specification from the ``use_unsigned`` parameter.
use_unsigned : boolean, default False

.. deprecated:: 0.18.2

Argument moved to ``pd.to_numeric``
Expand Down
2 changes: 1 addition & 1 deletion doc/source/missing_data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ When / why does data become missing?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Some might quibble over our usage of *missing*. By "missing" we simply mean
**NA** or "not present for whatever reason". Many data sets simply arrive with
**NA** ("not available") or "not present for whatever reason". Many data sets simply arrive with
missing data, either because it exists and was not collected or it never
existed. For example, in a collection of financial time series, some of the time
series might start on different dates. Thus, values prior to the start date
Expand Down
46 changes: 38 additions & 8 deletions doc/source/whatsnew/v0.10.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,45 @@ labeled the aggregated group with the end of the interval: the next day).
``notnull``. That they ever were was a relic of early pandas. This behavior
can be re-enabled globally by the ``mode.use_inf_as_null`` option:

.. ipython:: python
.. code-block:: ipython

s = pd.Series([1.5, np.inf, 3.4, -np.inf])
pd.isnull(s)
s.fillna(0)
pd.set_option('use_inf_as_null', True)
pd.isnull(s)
s.fillna(0)
pd.reset_option('use_inf_as_null')
In [6]: s = pd.Series([1.5, np.inf, 3.4, -np.inf])

In [7]: pd.isnull(s)
Out[7]:
0 False
1 False
2 False
3 False
Length: 4, dtype: bool

In [8]: s.fillna(0)
Out[8]:
0 1.500000
1 inf
2 3.400000
3 -inf
Length: 4, dtype: float64

In [9]: pd.set_option('use_inf_as_null', True)

In [10]: pd.isnull(s)
Out[10]:
0 False
1 True
2 False
3 True
Length: 4, dtype: bool

In [11]: s.fillna(0)
Out[11]:
0 1.5
1 0.0
2 3.4
3 0.0
Length: 4, dtype: float64

In [12]: pd.reset_option('use_inf_as_null')

- Methods with the ``inplace`` option now all return ``None`` instead of the
calling object. E.g. code written like ``df = df.fillna(0, inplace=True)``
Expand Down
2 changes: 1 addition & 1 deletion doc/source/whatsnew/v0.4.x.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ New Features
- Added Python 3 support using 2to3 (:issue:`200`)
- :ref:`Added <dsintro.name_attribute>` ``name`` attribute to ``Series``, now
prints as part of ``Series.__repr__``
- :ref:`Added <missing.isnull>` instance methods ``isnull`` and ``notnull`` to
- :ref:`Added <missing.isna>` instance methods ``isnull`` and ``notnull`` to
Series (:issue:`209`, :issue:`203`)
- :ref:`Added <basics.align>` ``Series.align`` method for aligning two series
with choice of join method (ENH56_)
Expand Down
4 changes: 2 additions & 2 deletions pandas/core/config_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,8 @@ def table_schema_cb(key):

use_inf_as_na_doc = """
: boolean
True means treat None, NaN, INF, -INF as na (old way),
False means None and NaN are null, but INF, -INF are not na
True means treat None, NaN, INF, -INF as NA (old way),
False means None and NaN are null, but INF, -INF are not NA
(new way).
"""

Expand Down

0 comments on commit 2537cfe

Please sign in to comment.