From a84bcb149cc499e74b02eff0134c8744bbf92aba Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Wed, 15 Aug 2018 15:47:01 +0200 Subject: [PATCH] DOC: edit docstring example to prevent segfault (#21824) --- pandas/core/frame.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index b35bc8325d560..78ad9728800d6 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -6896,21 +6896,21 @@ def count(self, axis=0, level=None, numeric_only=False): Constructing DataFrame from a dictionary: >>> df = pd.DataFrame({"Person": - ... ["John", "Myla", None, "John", "Myla"], + ... ["John", "Myla", "Lewis", "John", "Myla"], ... "Age": [24., np.nan, 21., 33, 26], ... "Single": [False, True, True, True, False]}) >>> df Person Age Single 0 John 24.0 False 1 Myla NaN True - 2 None 21.0 True + 2 Lewis 21.0 True 3 John 33.0 True 4 Myla 26.0 False Notice the uncounted NA values: >>> df.count() - Person 4 + Person 5 Age 4 Single 5 dtype: int64 @@ -6920,7 +6920,7 @@ def count(self, axis=0, level=None, numeric_only=False): >>> df.count(axis='columns') 0 3 1 2 - 2 2 + 2 3 3 3 4 3 dtype: int64 @@ -6931,7 +6931,9 @@ def count(self, axis=0, level=None, numeric_only=False): Age Person John 2 + Lewis 1 Myla 1 + """ axis = self._get_axis_number(axis) if level is not None: