Pandas DataFrame.count()The Pandas count() is defined as a method that is used to count the number of non-NA cells for each column or row. It is also suitable to work with the non-floating data. Syntax:Parameters:
Returns:It returns the count of Series or DataFrame if the level is specified. Example 1: The below example demonstrates the working of the count(). Output Person 5 Age 3 dtype: int64 Example 2: If we want to count for each of the row, we can use the axis parameter. The below code demonstrates the working of the axis parameter. Output 0 2 1 2 2 1 3 2 dtype: int64 Next TopicDataFrame.cut() |