[Tutor] code explanation
Tariq Khasiri
tariqkhasiri at gmail.com
Tue Nov 23 06:51:52 EST 2021
```
data = [[col, df[col].nunique()] for col in
df.columns.difference(["Reviews"])]
uniques = pd.DataFrame(data=data, columns=["columns", "num of unique
values"])
```
The first line is explaining the dataframe ( df) unique number of
elements in a column but i dont understand the the second half of the first
line of coding neither the second line of code. Can anyone help ?
More information about the Tutor
mailing list