You can try one of the 2 alternatives below.
df.groupby('country')['edition'].nunique().gt(1).sum()
or
(df.groupby('country')['edition'].nunique()>(1)).sum()
More Related Contents:
- Select rows in pandas MultiIndex DataFrame
- Apply vs transform on a group object
- Keep only date part when using pandas.to_datetime
- Strings in a DataFrame, but dtype is object
- Creating an empty Pandas DataFrame, then filling it?
- how do I insert a column at a specific column index in pandas?
- How to map numeric data into categories / bins in Pandas dataframe
- Modifying a subset of rows in a pandas dataframe
- Naming returned columns in Pandas aggregate function? [duplicate]
- Matplotlib DateFormatter for axis label not working
- How to plot multi-color line if x-axis is date time index of pandas
- How can I use cumsum within a group in Pandas?
- How to group DataFrame by a period of time?
- Why does df.apply(tuple) work but not df.apply(list)?
- Plot multiple columns of pandas DataFrame on the bar chart
- Python: Random selection per group
- Keep selected column as DataFrame instead of Series
- How to get unique values from multiple columns in a pandas groupby
- Merge a list of pandas dataframes
- Pandas reindex dates in Groupby
- How to repeat a Pandas DataFrame?
- Pandas ParserError EOF character when reading multiple csv files to HDF5
- Get column name where value is something in pandas dataframe
- Find index of all rows with null values in a particular column in pandas dataframe
- Python: How to drop a row whose particular column is empty/NaN?
- Discrete legend in seaborn heatmap plot
- Clean way to convert quarterly periods to datetime in pandas
- Combine Pandas data frame column values into new column
- Python Pandas : pandas.to_datetime() is switching day & month when day is less than 13
- Wide to long data transform in pandas