-
-
Save brandon-b-miller/2615e2f2e59e26a19f445d08ce8f0e87 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": 1, | |
"id": "6dee5622", | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"Row:\n", | |
"a 2\n", | |
"b 5\n", | |
"Name: 1, dtype: int64\n", | |
"Row elements:\n", | |
"2\n", | |
"5\n" | |
] | |
} | |
], | |
"source": [ | |
"import pandas as pd\n", | |
"\n", | |
"df = pd.DataFrame({\n", | |
" 'a': [1,2,3],\n", | |
" 'b': [4,5,6]\n", | |
"})\n", | |
"\n", | |
"row = df.iloc[1]\n", | |
"print(\"Row:\")\n", | |
"print(row)\n", | |
"\n", | |
"print(\"Row elements:\")\n", | |
"print(row['a'])\n", | |
"print(row['b'])" | |
] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"display_name": "Python 3 (ipykernel)", | |
"language": "python", | |
"name": "python3" | |
}, | |
"language_info": { | |
"codemirror_mode": { | |
"name": "ipython", | |
"version": 3 | |
}, | |
"file_extension": ".py", | |
"mimetype": "text/x-python", | |
"name": "python", | |
"nbconvert_exporter": "python", | |
"pygments_lexer": "ipython3", | |
"version": "3.8.13" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 5 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment