Skip to content
Open

Test #15

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"jupyter.jupyterServerType": "local"
}
Binary file not shown.
200 changes: 77 additions & 123 deletions ch05.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,79 +2,76 @@
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 18,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"import matplotlib.pyplot as plt\n",
"url = (\n",
" \"http://biostat.mc.vanderbilt.edu/\"\n",
" \"wiki/pub/Main/DataSets/titanic3.xls\"\n",
")\n",
"df = pd.read_excel(url)"
"# url = (\n",
"# \"http://biostat.mc.vanderbilt.edu/\"\n",
"# \"wiki/pub/Main/DataSets/titanic3.xls\"\n",
"# )\n",
"file = 'titanic3.xls'\n",
"df = pd.read_excel(file)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 24,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>a</th>\n",
" <th>_sales_numbers_</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>1.0</td>\n",
" <td>20.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>NaN</td>\n",
" <td>30.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>3.0</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" a _sales_numbers_\n",
"0 1.0 20.0\n",
"1 NaN 30.0\n",
"2 3.0 NaN"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
"name": "stdout",
"output_type": "stream",
"text": [
"Collecting virtualenv\n",
" Downloading virtualenv-20.8.1-py2.py3-none-any.whl (5.3 MB)\n",
"Collecting filelock<4,>=3.0.0\n",
" Downloading filelock-3.3.0-py3-none-any.whl (9.7 kB)\n",
"Requirement already satisfied: six<2,>=1.9.0 in c:\\users\\jnl11\\appdata\\local\\packages\\pythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0\\localcache\\local-packages\\python39\\site-packages (from virtualenv) (1.16.0)\n",
"Collecting distlib<1,>=0.3.1\n",
" Downloading distlib-0.3.3-py2.py3-none-any.whl (496 kB)\n",
"Collecting backports.entry-points-selectable>=1.0.4\n",
" Downloading backports.entry_points_selectable-1.1.0-py2.py3-none-any.whl (6.2 kB)\n",
"Collecting platformdirs<3,>=2\n",
" Downloading platformdirs-2.4.0-py3-none-any.whl (14 kB)\n",
"Installing collected packages: platformdirs, filelock, distlib, backports.entry-points-selectable, virtualenv\n",
"Successfully installed backports.entry-points-selectable-1.1.0 distlib-0.3.3 filelock-3.3.0 platformdirs-2.4.0 virtualenv-20.8.1\n",
"Note: you may need to restart the kernel to use updated packages.\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
" WARNING: The script virtualenv.exe is installed in 'C:\\Users\\jnl11\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python39\\Scripts' which is not on PATH.\n",
" Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.\n",
"WARNING: You are using pip version 21.2.3; however, version 21.2.4 is available.\n",
"You should consider upgrading via the 'C:\\Users\\jnl11\\AppData\\Local\\Microsoft\\WindowsApps\\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\\python.exe -m pip install --upgrade pip' command.\n"
]
}
],
"source": [
"pip install --upgrade virtualenv"
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {},
"outputs": [
{
"ename": "ModuleNotFoundError",
"evalue": "No module named 'ConfigParser'",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)",
"\u001b[1;32m~\\AppData\\Local\\Temp/ipykernel_24280/1679549584.py\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[1;32mimport\u001b[0m \u001b[0mjanitor\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0mjn\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 2\u001b[0m Xbad = pd.DataFrame(\n\u001b[0;32m 3\u001b[0m {\n\u001b[0;32m 4\u001b[0m \u001b[1;34m\"A\"\u001b[0m\u001b[1;33m:\u001b[0m \u001b[1;33m[\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;32mNone\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m3\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 5\u001b[0m \u001b[1;34m\" sales numbers \"\u001b[0m\u001b[1;33m:\u001b[0m \u001b[1;33m[\u001b[0m\u001b[1;36m20.0\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m30.0\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;32mNone\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
"\u001b[1;32m~\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python39\\site-packages\\janitor.py\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[0;32m 4\u001b[0m \"\"\"\n\u001b[0;32m 5\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0margparse\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 6\u001b[1;33m \u001b[1;32mimport\u001b[0m \u001b[0mConfigParser\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 7\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 8\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mflask\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mFlask\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0msend_from_directory\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
"\u001b[1;31mModuleNotFoundError\u001b[0m: No module named 'ConfigParser'"
]
}
],
"source": [
Expand All @@ -90,66 +87,21 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 17,
"metadata": {
"lines_to_next_cell": 2
},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>a</th>\n",
" <th>sales_numbers</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>1.0</td>\n",
" <td>20.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>NaN</td>\n",
" <td>30.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>3.0</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" a sales_numbers\n",
"0 1.0 20.0\n",
"1 NaN 30.0\n",
"2 3.0 NaN"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
"ename": "NameError",
"evalue": "name 'Xbad' is not defined",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)",
"\u001b[1;32m~\\AppData\\Local\\Temp/ipykernel_24280/2532706563.py\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[0;32m 3\u001b[0m \u001b[0mname\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mstrip\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mlower\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mreplace\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\" \"\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m\"_\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 4\u001b[0m )\n\u001b[1;32m----> 5\u001b[1;33m \u001b[0mXbad\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mrename\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mcolumns\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mclean_col\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[1;31mNameError\u001b[0m: name 'Xbad' is not defined"
]
}
],
"source": [
Expand All @@ -162,7 +114,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"metadata": {
"lines_to_next_cell": 2
},
Expand Down Expand Up @@ -230,7 +182,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"metadata": {
"lines_to_next_cell": 2
},
Expand Down Expand Up @@ -298,7 +250,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": null,
"metadata": {
"lines_to_next_cell": 2
},
Expand Down Expand Up @@ -370,7 +322,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand All @@ -390,12 +342,14 @@
}
],
"metadata": {
"interpreter": {
"hash": "3f914d2d7816feb4a88e80fd70cc214d8de2e25bd0daa73fd3488482bf615fdb"
},
"jupytext": {
"formats": "ipynb,py:light"
},
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"display_name": "Python 3.9.7 64-bit (windows store)",
"name": "python3"
},
"language_info": {
Expand All @@ -408,7 +362,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.4"
"version": "3.9.7"
}
},
"nbformat": 4,
Expand Down
5 changes: 5 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

## print('hi')
## Test Branch!

jkjkjkj
5 changes: 5 additions & 0 deletions test1.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import pandas as pd

file = 'titanic3.xls'

print('hello')
5 changes: 5 additions & 0 deletions test_123.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

## print('hi')
## Test Branch!

jkjkjkj
5 changes: 5 additions & 0 deletions test_123a.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

## print('hi')
## Test Branch!

jkjkjkj
Binary file added titanic3.xls
Binary file not shown.