Skip to content

Commit 4587c45

Browse files
authored
CLN/DOC: DataFrame.count remove references to "level" (#54395)
CLN/DOC: DataFrame.count
1 parent 62f8723 commit 4587c45

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

asv_bench/benchmarks/frame_methods.py

+2-11
Original file line numberDiff line numberDiff line change
@@ -512,19 +512,10 @@ def setup(self, axis):
512512
self.df_mixed = self.df.copy()
513513
self.df_mixed["foo"] = "bar"
514514

515-
self.df.index = MultiIndex.from_arrays([self.df.index, self.df.index])
516-
self.df.columns = MultiIndex.from_arrays([self.df.columns, self.df.columns])
517-
self.df_mixed.index = MultiIndex.from_arrays(
518-
[self.df_mixed.index, self.df_mixed.index]
519-
)
520-
self.df_mixed.columns = MultiIndex.from_arrays(
521-
[self.df_mixed.columns, self.df_mixed.columns]
522-
)
523-
524-
def time_count_level_multi(self, axis):
515+
def time_count(self, axis):
525516
self.df.count(axis=axis)
526517

527-
def time_count_level_mixed_dtypes_multi(self, axis):
518+
def time_count_mixed_dtypes(self, axis):
528519
self.df_mixed.count(axis=axis)
529520

530521

pandas/core/frame.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -10991,9 +10991,8 @@ def count(self, axis: Axis = 0, numeric_only: bool = False):
1099110991
1099210992
Returns
1099310993
-------
10994-
Series or DataFrame
10994+
Series
1099510995
For each column/row the number of non-NA/null entries.
10996-
If `level` is specified returns a `DataFrame`.
1099710996
1099810997
See Also
1099910998
--------
@@ -11051,7 +11050,7 @@ def count(self, axis: Axis = 0, numeric_only: bool = False):
1105111050
else:
1105211051
result = notna(frame).sum(axis=axis)
1105311052

11054-
return result.astype("int64").__finalize__(self, method="count")
11053+
return result.astype("int64", copy=False).__finalize__(self, method="count")
1105511054

1105611055
def _reduce(
1105711056
self,

0 commit comments

Comments
 (0)