Pandas Series.value_counts()The value_counts() function returns a Series that contain counts of unique values. It returns an object that will be in descending order so that its first element will be the most frequently-occurred element. By default, it excludes NA values. SyntaxParameters
ReturnsIt returns the counted series. Example1Output 1.0 2 3.0 1 2.0 1 dtype: int64 Example2Output 1.0 0.50 3.0 0.25 2.0 0.25 dtype: float64 Example3Output (0.997, 2.0] 4 (2.0, 3.0] 1 dtype: int64 Example4Output 2.0 2 1.0 2 NaN 1 3.0 1 dtype: int64 Next TopicPandas DataFrame |