<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Welcome to the Jupyter Notebook
I might slip and call it the "IPython Notebook" sometimes, because it was originally just for interactive Python sessions.  But it does much more now (including R and Julia).
What is it?
This "notebook" is my go-to version of the Lab Book you might have seen in bench science.  It captures a fluid mix of text (in "markdown" format, with decent support for $\LaTeX$) and computation, in this case in Python.
Step1:  Why does it work so well for me?
The Donald Knuth had a dream of "literate programming" which captivated me years ago, but I could never really do it until I had the notebook technology.
The notebook works really well for including plots and other graphics as well.
Step2:  We will use two "packages" for the hands-on portion of this tutorial
Pandas
Scikit-Learn
Pandas
This is a panel data package with a cute name.
Step3:  Scikit-Learn
This is a python-based machine learning library that has a lot of great methods in a common framework.
<ASSISTANT_TASK:>
Python Code:
# this is a python comment
# this cell contains python code
# executing the cell yields the results of the python command
2+2
Explanation: Welcome to the Jupyter Notebook
I might slip and call it the "IPython Notebook" sometimes, because it was originally just for interactive Python sessions.  But it does much more now (including R and Julia).
What is it?
This "notebook" is my go-to version of the Lab Book you might have seen in bench science.  It captures a fluid mix of text (in "markdown" format, with decent support for $\LaTeX$) and computation, in this case in Python.
End of explanation
# live code some graphics here
import matplotlib.pyplot as plt
%matplotlib inline
plt.plot([3,1,4,1,5])
plt.style.use("fivethirtyeight")
plt.plot([3,1,4,1,5])
# your turn: plot some additional digits of pi
import sympy
# to digits and then plot
pi_str = str(sympy.N(sympy.pi, n=100))
pi_digits = [int(x) for x in pi_str if x != '.']
plt.plot(pi_digits)
Explanation: Why does it work so well for me?
The Donald Knuth had a dream of "literate programming" which captivated me years ago, but I could never really do it until I had the notebook technology.
The notebook works really well for including plots and other graphics as well.
End of explanation
# live code an example of loading the va data csv with pandas here
import pandas as pd
df = pd.read_csv('../3-data/IHME_PHMRC_VA_DATA_ADULT_Y2013M09D11_0.csv', low_memory=False)
# DataFrame.iloc method selects row and columns by "integer location"
df.iloc[5:10, 5:10]
# If you are new to this sort of thing, what do you think this does?
df.iloc[5:10, :10]
# I don't have time to show you the details now, but I find that
# pandas DataFrames have really done things well.  For example:
df.gs_text34
df.gs_text34.value_counts()
Explanation: We will use two "packages" for the hands-on portion of this tutorial
Pandas
Scikit-Learn
Pandas
This is a panel data package with a cute name.
End of explanation
# you can guess what the next line does, 
# even if you have never used python before:
import sklearn.neighbors
# here is how sklearn creates a "classifier":
clf = sklearn.neighbors.KNeighborsClassifier()
# I didn't mention `numpy` before, but this is "the fundamental
# package for scientific computing with Python"
import numpy as np
# sklearn gets mixed up with Pandas DataFrames and Series,
# so you need to turn things into np.arrays:
X = np.array(df.loc[:, ['va46']])
y = np.array(df.gs_text34)
# one nice thing about sklearn is that it has all different
# fancy machine learning methods, but they all follow a
# common pattern:
clf.fit(X, y)
clf.predict([[19]])
Explanation: Scikit-Learn
This is a python-based machine learning library that has a lot of great methods in a common framework.
End of explanation
<END_TASK>