diff --git a/src/03-format.ipynb b/src/03-format.ipynb index cc4abc0..3419a7e 100644 --- a/src/03-format.ipynb +++ b/src/03-format.ipynb @@ -504,7 +504,7 @@ "outputs": [], "source": [ "# Pour chaque valeur, déterminer si non définie\n", - "surveys_df.isnull()" + "surveys_df.isna()" ] }, { @@ -517,7 +517,7 @@ "outputs": [], "source": [ "# For each value, is the value undefined\n", - "surveys_df.isnull()" + "surveys_df.isna()" ] }, { @@ -530,7 +530,7 @@ "outputs": [], "source": [ "# Sélectionner les enregistrements ayant au moins une valeur NaN\n", - "masque_nan = surveys_df.isnull().any(axis='columns')\n", + "masque_nan = surveys_df.isna().any(axis='columns')\n", "surveys_df[masque_nan]" ] }, @@ -544,7 +544,7 @@ "outputs": [], "source": [ "# Select rows with at least one undefined value\n", - "nan_mask = surveys_df.isnull().any(axis='columns')\n", + "nan_mask = surveys_df.isna().any(axis='columns')\n", "surveys_df[nan_mask]" ] }, @@ -558,7 +558,7 @@ "outputs": [], "source": [ "# Qu'est-ce que le code suivant va retourner?\n", - "une_selection = surveys_df[surveys_df['weight'].isnull()]\n", + "une_selection = surveys_df[surveys_df['weight'].isna()]\n", "une_selection.groupby('species_id')['record_id'].count()" ] }, @@ -572,7 +572,7 @@ "outputs": [], "source": [ "# What does this do?\n", - "one_selection = surveys_df[surveys_df['weight'].isnull()]\n", + "one_selection = surveys_df[surveys_df['weight'].isna()]\n", "one_selection.groupby('species_id')['record_id'].count()" ] }, @@ -952,8 +952,7 @@ " * Méthodes : `astype()`\n", "* **Nettoyage**\n", " * `df.copy()`\n", - " * `isna()`, `isnull()` (le second est un alias du premier)\n", - " * `notna()`, `notnull()` (le second est un alias du premier)\n", + " * `isna()`, `notna()`\n", " * `colonne.fillna(valeur, inplace=True)`\n", "* **Sauvegarde**\n", " * `df.to_csv(nom_csv, index=False)`" @@ -975,8 +974,7 @@ " * Method: `astype()`\n", "* **Cleaning data**\n", " * `df.copy()`\n", - " * `isna()`, `isnull()` (the second is an alias of the first)\n", - " * `notna()`, `notnull()` (the second is an alias of the first)\n", + " * `isna()`, `notna()`\n", " * `column.fillna(value, inplace=True)`\n", "* **Saving a DataFrame**\n", " * `df.to_csv(csv_filename, index=False)`"