Skip to content

Commit b03f7e5

Browse files
DOC: further clean-up null/na changes (#17113)
1 parent 465c59f commit b03f7e5

File tree

6 files changed

+44
-19
lines changed

6 files changed

+44
-19
lines changed

doc/source/basics.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ optional ``level`` parameter which applies only if the object has a
511511
:header: "Function", "Description"
512512
:widths: 20, 80
513513

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

546546
.. ipython:: python
547547

doc/source/io.rst

-5
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ usecols : array-like or callable, default ``None``
137137
138138
Using this parameter results in much faster parsing time and lower memory usage.
139139
as_recarray : boolean, default ``False``
140-
141140
.. deprecated:: 0.18.2
142141

143142
Please call ``pd.read_csv(...).to_records()`` instead.
@@ -193,7 +192,6 @@ skiprows : list-like or integer, default ``None``
193192
skipfooter : int, default ``0``
194193
Number of lines at bottom of file to skip (unsupported with engine='c').
195194
skip_footer : int, default ``0``
196-
197195
.. deprecated:: 0.19.0
198196

199197
Use the ``skipfooter`` parameter instead, as they are identical
@@ -208,13 +206,11 @@ low_memory : boolean, default ``True``
208206
use the ``chunksize`` or ``iterator`` parameter to return the data in chunks.
209207
(Only valid with C parser)
210208
buffer_lines : int, default None
211-
212209
.. deprecated:: 0.19.0
213210

214211
Argument removed because its value is not respected by the parser
215212

216213
compact_ints : boolean, default False
217-
218214
.. deprecated:: 0.19.0
219215

220216
Argument moved to ``pd.to_numeric``
@@ -223,7 +219,6 @@ compact_ints : boolean, default False
223219
parser will attempt to cast it as the smallest integer ``dtype`` possible, either
224220
signed or unsigned depending on the specification from the ``use_unsigned`` parameter.
225221
use_unsigned : boolean, default False
226-
227222
.. deprecated:: 0.18.2
228223

229224
Argument moved to ``pd.to_numeric``

doc/source/missing_data.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ When / why does data become missing?
3636
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3737

3838
Some might quibble over our usage of *missing*. By "missing" we simply mean
39-
**NA** or "not present for whatever reason". Many data sets simply arrive with
39+
**NA** ("not available") or "not present for whatever reason". Many data sets simply arrive with
4040
missing data, either because it exists and was not collected or it never
4141
existed. For example, in a collection of financial time series, some of the time
4242
series might start on different dates. Thus, values prior to the start date

doc/source/whatsnew/v0.10.0.txt

+38-8
Original file line numberDiff line numberDiff line change
@@ -128,15 +128,45 @@ labeled the aggregated group with the end of the interval: the next day).
128128
``notnull``. That they ever were was a relic of early pandas. This behavior
129129
can be re-enabled globally by the ``mode.use_inf_as_null`` option:
130130

131-
.. ipython:: python
131+
.. code-block:: ipython
132132

133-
s = pd.Series([1.5, np.inf, 3.4, -np.inf])
134-
pd.isnull(s)
135-
s.fillna(0)
136-
pd.set_option('use_inf_as_null', True)
137-
pd.isnull(s)
138-
s.fillna(0)
139-
pd.reset_option('use_inf_as_null')
133+
In [6]: s = pd.Series([1.5, np.inf, 3.4, -np.inf])
134+
135+
In [7]: pd.isnull(s)
136+
Out[7]:
137+
0 False
138+
1 False
139+
2 False
140+
3 False
141+
Length: 4, dtype: bool
142+
143+
In [8]: s.fillna(0)
144+
Out[8]:
145+
0 1.500000
146+
1 inf
147+
2 3.400000
148+
3 -inf
149+
Length: 4, dtype: float64
150+
151+
In [9]: pd.set_option('use_inf_as_null', True)
152+
153+
In [10]: pd.isnull(s)
154+
Out[10]:
155+
0 False
156+
1 True
157+
2 False
158+
3 True
159+
Length: 4, dtype: bool
160+
161+
In [11]: s.fillna(0)
162+
Out[11]:
163+
0 1.5
164+
1 0.0
165+
2 3.4
166+
3 0.0
167+
Length: 4, dtype: float64
168+
169+
In [12]: pd.reset_option('use_inf_as_null')
140170

141171
- Methods with the ``inplace`` option now all return ``None`` instead of the
142172
calling object. E.g. code written like ``df = df.fillna(0, inplace=True)``

doc/source/whatsnew/v0.4.x.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ New Features
99
- Added Python 3 support using 2to3 (:issue:`200`)
1010
- :ref:`Added <dsintro.name_attribute>` ``name`` attribute to ``Series``, now
1111
prints as part of ``Series.__repr__``
12-
- :ref:`Added <missing.isnull>` instance methods ``isnull`` and ``notnull`` to
12+
- :ref:`Added <missing.isna>` instance methods ``isnull`` and ``notnull`` to
1313
Series (:issue:`209`, :issue:`203`)
1414
- :ref:`Added <basics.align>` ``Series.align`` method for aligning two series
1515
with choice of join method (ENH56_)

pandas/core/config_init.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -398,8 +398,8 @@ def table_schema_cb(key):
398398

399399
use_inf_as_na_doc = """
400400
: boolean
401-
True means treat None, NaN, INF, -INF as na (old way),
402-
False means None and NaN are null, but INF, -INF are not na
401+
True means treat None, NaN, INF, -INF as NA (old way),
402+
False means None and NaN are null, but INF, -INF are not NA
403403
(new way).
404404
"""
405405

0 commit comments

Comments
 (0)