<jupyter_start><jupyter_text>Jupyter Notebook Slide Presentation - BIOF309 Spring 2019 by <NAME><jupyter_code>#To create a plot on a csv on heart disease, does cholesterol increase as age increases?

# f rep file. open is the function and the attributes are the csv file and r to read it for the 1st attempt.
#kaggle datasets download -d ronitf/heart-disease-uci
f = open('heart.csv', 'r')

for loop of every line in f or file. this looks thru each line in the file
#loop over rows in a python dataframe
for line in f:
    # printed to make sure the file can be read without bugs
    print(line)

    # create a new variable of new_line that is equal to the original line combined with
    # the function split (on attributes of a comma)
    new_line = line.split(',')

    #print new_line variable to test
    print(new_line)

    # pull on csv variables age and cholesterol within the new_line[element in array is 0 and 4]
    age = new_line[0]
    chol = new_line[4]
    #print those 2 selected variables of the data set 
    print(age, chol)
#using a kernel in the kaggle environment already linked to the csv by way of ('../input/heart.csv')
df_heart = pd.read_csv('../input/heart.csv')
#print the shape of the csv as columns and rows
print("heart disease : ", df_heart.shape)
#view the for two rows
df_heart.head(2)

#The scatter matrix module of the pandas plotting tool is imported.
from pandas.plotting import scatter_matrix
#with help from the instructor, the iloc method is used pulling elements 
#from the array as an index location to be the foundation to test the data viz.
scatter_matrix(df_heart.iloc[:,:3])

#import the pandas matplotlib
import matplotlib.pyplot as plt
#show the scatter plot 
plt.show()
# The csv is a data set on Heart disease from the University of California Irvine
# The csv was pulled from Kaggle and the code was tested in a Kaggle kernel
# It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python

import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

df = pd.read_csv('https://raw.githubusercontent.com/AVGeller/biof309/master/heart.csv')
    #"""This dataframe is read by pandas from a github url for ease of access. """
df.head(2)
    #""" The first two rows of the data frame are displayed to test that it works. The docstrings prevented the code from running. # was used for the code to work."""
from pandas.plotting import scatter_matrix
    #""" The scatter matrix module of the pandas plotting tool is imported. """
df.plot.scatter(x='age', y="chol")
    #""" The x-axis attribute is defined as 'age' and the y-axis is defined as 'cholesterol'."""

import matplotlib.pyplot as plt
plt.show()
    #""" The matplot library from pandas is imported and the show function is called for the data visualization."""<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.07831534980856247, 'fraction_numerical': 0.006613296206056387, 'mean_word_length': 3.972318339100346, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '640003', 'license': 'MIT', 'n_tokens_mistral': 881, 'n_tokens_neox': 827, 'n_words': 406, 'path': 'kaggle_heart_coded.ipynb', 'repo_name': 'biof309/spring2019-solo-project-AVGeller', 'size': '2880'}