<jupyter_start><jupyter_text>**Download** (right-click, save target as ...) this page as a jupyterlab notebook from: [Lab15-HW](http://5172.16.58.3/engr-1330-webroot/8-Labs/Lab15/Lab15-TH.ipynb)___  Exercise Set 15: Matplotlib LAST NAME, FIRST NAMER00000000ENGR 1330 ES-15 - Homework<jupyter_code># Preamble script block to identify host, user, and kernel
import sys
! hostname
! whoami
print(sys.executable)
print(sys.version)
print(sys.version_info)
! pwd
# Import dependencies!

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt<jupyter_output><empty_output><jupyter_text>Line Plots  Exercise 1The table below contains experimental observations. |Elapsed Time (s)|Speed (m/s)||---:|---:||0 |0||1.01 |3||2.07 |7||3.3 |12||4.2 |20||5.3 |30||6.1 | 45.6| Plot the speed vs time (speed on y-axis, time on x-axis) using a line plot.From examination of  the plot, estimate the speed at time t = 5.0 (eyeball estimate)<jupyter_code># Create two lists; time  and speed

# Create a line chart of speed on y axis and time on x axis

# Estimate:<jupyter_output><empty_output><jupyter_text>Exercise 2Using the same series from Exercise 1, Plot the speed vs time (speed on y-axis, time on x-axis) using a scatter plot.From examination of  the plot, estimate the speed at time t = 2.0 (eyeball estimate)<jupyter_code># Create a scatterplot chart

# Estimate:<jupyter_output><empty_output><jupyter_text>Exercise 3Using the same series from Exercise 1, Plot the speed vs time (speed on y-axis, time on x-axis) using a line plot. Plot a second line based on the linear model $$y = mx + b$$ where $$b=0~\text{and}~m=7.6$$<jupyter_code># Code and run your solution here:<jupyter_output><empty_output><jupyter_text>Exercise 4Using trial and error try to improve the 'fit' of the model, by adjusting values of $$m~\text{and}~b$$.<jupyter_code># Code and run your solution here:<jupyter_output><empty_output><jupyter_text>Exercise 5Use pandas to read a dataframe from the file `http://54.243.252.9/engr-1330-webroot/8-Labs/Lab15/census_18.csv`.  Then produce a line plot ofthe counts by age for the 2010 census, x-axis will be the series `age`, y-axis will be the census values for `2010`.<jupyter_code>######### CODE TO AUTOMATICALLY DOWNLOAD THE DATABASE ################
import requests # import needed modules to interact with the internet
# make the connection to the remote file (actually its implementing "bash curl -O http://fqdn/path ...")
remote_url = 'http://5172.16.58.3/engr-1330-webroot/8-Labs/Lab15/census_18.csv' # a csv file
response = requests.get(remote_url) # Gets the file contents puts into an object
output = open('census_18.csv', 'wb') # Prepare a destination, local
output.write(response.content) # write contents of object to named local file
output.close() # close the connection
# Code and run your file read here

# Code and run your plot here<jupyter_output><empty_output><jupyter_text>Exercise 6Using your dataframe from exercise 5, plot both the 2010 and 2014 census values by age. Plot the 2010 distribution in blue and the 2014 distribution in red.<jupyter_code># Code and run your plot here<jupyter_output><empty_output><jupyter_text>--- Bar Charts --- Exercise 7Consider the data set "data" defined as    data = {'C':20, 'C++':15, 'Java':30, 'Python':35}     which lists student count by programming language in some school.Produce a bar chart of number of students in each language, where language is the classification, and student count is the variable.<jupyter_code># Code and run your solution here<jupyter_output><empty_output><jupyter_text>--- Exercise 8Repeat Exercise 7 but use a horizontal bar chart.<jupyter_code># Code and run your solution here<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10767991407089152, 'fraction_numerical': 0.04081632653061224, 'mean_word_length': 5.167218543046357, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 3, 'substrings_counts': 1, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '9', 'dir': 'jupyter-structured-clean-dedup', 'id': '75059', 'license': 'CC0-1.0', 'n_tokens_mistral': 1301, 'n_tokens_neox': 1183, 'n_words': 445, 'path': '8-Labs/Lab15/Lab15-TH.ipynb', 'repo_name': 'dustykat/engr-1330-psuedo-course', 'size': '3724'}