diff --git a/tutorials/things_in_pandas.ipynb b/tutorials/things_in_pandas.ipynb index 968d734..f9d8715 100644 --- a/tutorials/things_in_pandas.ipynb +++ b/tutorials/things_in_pandas.ipynb @@ -2662,7 +2662,8 @@ "source": [ "# Selecting only those players that either playing for Arsenal or Chelsea\n", "\n", - "df[ (df['team'] == 'arsenal') | (df['team'] == 'chelsea') ]" + "# df[ (df['team'] == 'arsenal') | (df['team'] == 'chelsea') ]\n", + "df.query(\"team in ('arsenal','chelsea')\")\n" ] }, { @@ -2726,7 +2727,8 @@ "source": [ "# Selecting forwards from Arsenal only\n", "\n", - "df[ (df['team'] == 'arsenal') & (df['position'] == 'forward') ]" + "# df[ (df['team'] == 'arsenal') & (df['position'] == 'forward') ]\n", + "df.query(\"team == 'arsenal' and position == 'forward'\")" ] }, {