Skip to content

Commit 124356d

Browse files
committed
Update Pandas_walkthrough.ipynb
1 parent 25001e9 commit 124356d

1 file changed

Lines changed: 8 additions & 13 deletions

File tree

notebooks/Pandas_walkthrough.ipynb

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"source": [
88
"# Pandas\n",
99
"\n",
10-
"Copyright 2023 Marco A. Lopez-Sanchez. \n",
10+
"Copyright 2023-2025 Marco A. Lopez-Sanchez. \n",
1111
"Content under [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) License](http://creativecommons.org/licenses/by-nc-sa/4.0/).\n",
1212
"\n",
1313
"> **Goal**: \n",
@@ -990,8 +990,8 @@
990990
"\n",
991991
"> 👉 When subsetting a DataFrame it is good practice to use the ``.copy()`` method because what you get by default is a view of the original DataFrame and all modifications you make to this new DataFrame will affect the original one. This is: \n",
992992
">```python\n",
993-
">new_df = df.loc[['CO_eclogite', 'CO_granulite', 'CO_pyroxenite']] ❌ \n",
994-
">new_df = df.loc[['CO_eclogite', 'CO_granulite', 'CO_pyroxenite']].copy() ✅ \n",
993+
">new_df = df.loc[:, ['CO_eclogite', 'CO_granulite', 'CO_pyroxenite']] ❌ \n",
994+
">new_df = df.loc[:, ['CO_eclogite', 'CO_granulite', 'CO_pyroxenite']].copy() ✅ \n",
995995
">```\n",
996996
"> ⚠️ Beware! Contrary to regular Python or Numpy, the Pandas ``.loc`` method **includes** the index stop point so that ``df.loc[0:2]`` is equivalent to ``array[0:3]``"
997997
]
@@ -2019,9 +2019,9 @@
20192019
"name": "stdout",
20202020
"output_type": "stream",
20212021
"text": [
2022-
"Notebook tested in 2024-04-10 using:\n",
2023-
"Python 3.11.8 | packaged by Anaconda, Inc. | (main, Feb 26 2024, 21:34:05) [MSC v.1916 64 bit (AMD64)]\n",
2024-
"Pandas 2.1.4\n"
2022+
"Notebook tested in 2025-01-22 using:\n",
2023+
"Python 3.12.4 | packaged by Anaconda, Inc. | (main, Jun 18 2024, 15:03:56) [MSC v.1929 64 bit (AMD64)]\n",
2024+
"Pandas 2.2.3\n"
20252025
]
20262026
}
20272027
],
@@ -2038,7 +2038,7 @@
20382038
],
20392039
"metadata": {
20402040
"kernelspec": {
2041-
"display_name": "Python 3 (ipykernel)",
2041+
"display_name": "main",
20422042
"language": "python",
20432043
"name": "python3"
20442044
},
@@ -2052,12 +2052,7 @@
20522052
"name": "python",
20532053
"nbconvert_exporter": "python",
20542054
"pygments_lexer": "ipython3",
2055-
"version": "3.11.8"
2056-
},
2057-
"vscode": {
2058-
"interpreter": {
2059-
"hash": "073408933f31e8ac7f6b4bf29a6f48e1a2f613d7d5b6e5c6c58fd8fdc8389e42"
2060-
}
2055+
"version": "3.12.4"
20612056
}
20622057
},
20632058
"nbformat": 4,

0 commit comments

Comments
 (0)