We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Incorrect duplicate rows count
### Current Behaviour

The duplicated rows count is different between pandas and pandas-profiling when there are nan's in columns

### Expected Behaviour

The count should be equal

### Data Description

I attach a simple example

![image](https://user-images.githubusercontent.com/61322372/180415055-83fc2fec-fc2a-4921-acf9-0a9a38ccb645.png)


### Code that reproduces the bug

```Python
import pandas as pd
import numpy as np

df = pd.DataFrame({"a": [np.nan, np.nan, 2], "b": [1, 1, 3]})
sum(df.duplicated())

from pandas_profiling import ProfileReport

profile = ProfileReport(df, title="Pandas Profiling Report")
```


### pandas-profiling version

3.2.0

### Dependencies

```Text
numpy==1.22.4
pandas==1.3.3
```


### OS

_No response_

### Checklist

- [X] There is not yet another bug report for this issue in the [issue tracker](https://github.com/ydataai/pandas-profiling/issues)
- [X] The problem is reproducible from this bug report. [This guide](http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports) can help to craft a minimal bug report.
- [X] The issue has not been resolved by the entries listed under [Common Issues](https://pandas-profiling.ydata.ai/docs/master/pages/support_contrib/common_issues.html).

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `src/pandas_profiling/model/pandas/duplicates_pandas.py`
Content:
```
1 from typing import Any, Dict, Optional, Sequence, Tuple
2 
3 import pandas as pd
4 
5 from pandas_profiling.config import Settings
6 from pandas_profiling.model.duplicates import get_duplicates
7 
8 
9 @get_duplicates.register(Settings, pd.DataFrame, Sequence)
10 def pandas_get_duplicates(
11     config: Settings, df: pd.DataFrame, supported_columns: Sequence
12 ) -> Tuple[Dict[str, Any], Optional[pd.DataFrame]]:
13     """Obtain the most occurring duplicate rows in the DataFrame.
14 
15     Args:
16         config: report Settings object
17         df: the Pandas DataFrame.
18         supported_columns: the columns to consider
19 
20     Returns:
21         A subset of the DataFrame, ordered by occurrence.
22     """
23     n_head = config.duplicates.head
24 
25     metrics: Dict[str, Any] = {}
26     if n_head > 0:
27         if supported_columns and len(df) > 0:
28             duplicates_key = config.duplicates.key
29             if duplicates_key in df.columns:
30                 raise ValueError(
31                     f"Duplicates key ({duplicates_key}) may not be part of the DataFrame. Either change the "
32                     f" column name in the DataFrame or change the 'duplicates.key' parameter."
33                 )
34 
35             duplicated_rows = df.duplicated(subset=supported_columns, keep=False)
36             duplicated_rows = (
37                 df[duplicated_rows]
38                 .groupby(supported_columns)
39                 .size()
40                 .reset_index(name=duplicates_key)
41             )
42 
43             metrics["n_duplicates"] = len(duplicated_rows[duplicates_key])
44             metrics["p_duplicates"] = metrics["n_duplicates"] / len(df)
45 
46             return (
47                 metrics,
48                 duplicated_rows.nlargest(n_head, duplicates_key),
49             )
50         else:
51             metrics["n_duplicates"] = 0
52             metrics["p_duplicates"] = 0.0
53             return metrics, None
54     else:
55         return metrics, None
56
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/src/pandas_profiling/model/pandas/duplicates_pandas.py b/src/pandas_profiling/model/pandas/duplicates_pandas.py
--- a/src/pandas_profiling/model/pandas/duplicates_pandas.py
+++ b/src/pandas_profiling/model/pandas/duplicates_pandas.py
@@ -35,7 +35,7 @@
             duplicated_rows = df.duplicated(subset=supported_columns, keep=False)
             duplicated_rows = (
                 df[duplicated_rows]
-                .groupby(supported_columns)
+                .groupby(supported_columns, dropna=False)
                 .size()
                 .reset_index(name=duplicates_key)
             )

{"golden_diff": "diff --git a/src/pandas_profiling/model/pandas/duplicates_pandas.py b/src/pandas_profiling/model/pandas/duplicates_pandas.py\n--- a/src/pandas_profiling/model/pandas/duplicates_pandas.py\n+++ b/src/pandas_profiling/model/pandas/duplicates_pandas.py\n@@ -35,7 +35,7 @@\n             duplicated_rows = df.duplicated(subset=supported_columns, keep=False)\n             duplicated_rows = (\n                 df[duplicated_rows]\n-                .groupby(supported_columns)\n+                .groupby(supported_columns, dropna=False)\n                 .size()\n                 .reset_index(name=duplicates_key)\n             )\n", "issue": "Incorrect duplicate rows count\n### Current Behaviour\n\nThe duplicated rows count is different between pandas and pandas-profiling when there are nan's in columns\n\n### Expected Behaviour\n\nThe count should be equal\n\n### Data Description\n\nI attach a simple example\r\n\r\n![image](https://user-images.githubusercontent.com/61322372/180415055-83fc2fec-fc2a-4921-acf9-0a9a38ccb645.png)\r\n\n\n### Code that reproduces the bug\n\n```Python\nimport pandas as pd\r\nimport numpy as np\r\n\r\ndf = pd.DataFrame({\"a\": [np.nan, np.nan, 2], \"b\": [1, 1, 3]})\r\nsum(df.duplicated())\r\n\r\nfrom pandas_profiling import ProfileReport\r\n\r\nprofile = ProfileReport(df, title=\"Pandas Profiling Report\")\n```\n\n\n### pandas-profiling version\n\n3.2.0\n\n### Dependencies\n\n```Text\nnumpy==1.22.4\r\npandas==1.3.3\n```\n\n\n### OS\n\n_No response_\n\n### Checklist\n\n- [X] There is not yet another bug report for this issue in the [issue tracker](https://github.com/ydataai/pandas-profiling/issues)\n- [X] The problem is reproducible from this bug report. [This guide](http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports) can help to craft a minimal bug report.\n- [X] The issue has not been resolved by the entries listed under [Common Issues](https://pandas-profiling.ydata.ai/docs/master/pages/support_contrib/common_issues.html).\n", "before_files": [{"content": "from typing import Any, Dict, Optional, Sequence, Tuple\n\nimport pandas as pd\n\nfrom pandas_profiling.config import Settings\nfrom pandas_profiling.model.duplicates import get_duplicates\n\n\n@get_duplicates.register(Settings, pd.DataFrame, Sequence)\ndef pandas_get_duplicates(\n    config: Settings, df: pd.DataFrame, supported_columns: Sequence\n) -> Tuple[Dict[str, Any], Optional[pd.DataFrame]]:\n    \"\"\"Obtain the most occurring duplicate rows in the DataFrame.\n\n    Args:\n        config: report Settings object\n        df: the Pandas DataFrame.\n        supported_columns: the columns to consider\n\n    Returns:\n        A subset of the DataFrame, ordered by occurrence.\n    \"\"\"\n    n_head = config.duplicates.head\n\n    metrics: Dict[str, Any] = {}\n    if n_head > 0:\n        if supported_columns and len(df) > 0:\n            duplicates_key = config.duplicates.key\n            if duplicates_key in df.columns:\n                raise ValueError(\n                    f\"Duplicates key ({duplicates_key}) may not be part of the DataFrame. Either change the \"\n                    f\" column name in the DataFrame or change the 'duplicates.key' parameter.\"\n                )\n\n            duplicated_rows = df.duplicated(subset=supported_columns, keep=False)\n            duplicated_rows = (\n                df[duplicated_rows]\n                .groupby(supported_columns)\n                .size()\n                .reset_index(name=duplicates_key)\n            )\n\n            metrics[\"n_duplicates\"] = len(duplicated_rows[duplicates_key])\n            metrics[\"p_duplicates\"] = metrics[\"n_duplicates\"] / len(df)\n\n            return (\n                metrics,\n                duplicated_rows.nlargest(n_head, duplicates_key),\n            )\n        else:\n            metrics[\"n_duplicates\"] = 0\n            metrics[\"p_duplicates\"] = 0.0\n            return metrics, None\n    else:\n        return metrics, None\n", "path": "src/pandas_profiling/model/pandas/duplicates_pandas.py"}], "after_files": [{"content": "from typing import Any, Dict, Optional, Sequence, Tuple\n\nimport pandas as pd\n\nfrom pandas_profiling.config import Settings\nfrom pandas_profiling.model.duplicates import get_duplicates\n\n\n@get_duplicates.register(Settings, pd.DataFrame, Sequence)\ndef pandas_get_duplicates(\n    config: Settings, df: pd.DataFrame, supported_columns: Sequence\n) -> Tuple[Dict[str, Any], Optional[pd.DataFrame]]:\n    \"\"\"Obtain the most occurring duplicate rows in the DataFrame.\n\n    Args:\n        config: report Settings object\n        df: the Pandas DataFrame.\n        supported_columns: the columns to consider\n\n    Returns:\n        A subset of the DataFrame, ordered by occurrence.\n    \"\"\"\n    n_head = config.duplicates.head\n\n    metrics: Dict[str, Any] = {}\n    if n_head > 0:\n        if supported_columns and len(df) > 0:\n            duplicates_key = config.duplicates.key\n            if duplicates_key in df.columns:\n                raise ValueError(\n                    f\"Duplicates key ({duplicates_key}) may not be part of the DataFrame. Either change the \"\n                    f\" column name in the DataFrame or change the 'duplicates.key' parameter.\"\n                )\n\n            duplicated_rows = df.duplicated(subset=supported_columns, keep=False)\n            duplicated_rows = (\n                df[duplicated_rows]\n                .groupby(supported_columns, dropna=False)\n                .size()\n                .reset_index(name=duplicates_key)\n            )\n\n            metrics[\"n_duplicates\"] = len(duplicated_rows[duplicates_key])\n            metrics[\"p_duplicates\"] = metrics[\"n_duplicates\"] / len(df)\n\n            return (\n                metrics,\n                duplicated_rows.nlargest(n_head, duplicates_key),\n            )\n        else:\n            metrics[\"n_duplicates\"] = 0\n            metrics[\"p_duplicates\"] = 0.0\n            return metrics, None\n    else:\n        return metrics, None\n", "path": "src/pandas_profiling/model/pandas/duplicates_pandas.py"}]}