Download (right-click, save target as ...) this page as a jupyterlab notebook from: ES-12
LAST NAME, FIRST NAME
R00000000
ENGR 1330 ES 12 - Homework
import sys
! hostname
! whoami
print(sys.executable)
This homework involves a winequality database, our first step is to get the database. Run the script below to get the database. If it does not work for you, then manually get the database from the URL in the script
######### CODE TO AUTOMATICALLY DOWNLOAD THE DATABASE ################
#! pip install requests #install packages into local environment
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 = 'https://archive.ics.uci.edu/ml/machine-learning-databases/wine-quality/winequality-red.csv' # a csv file
response = requests.get(remote_url) # Gets the file contents puts into an object
output = open('winequality-red.csv', 'wb') # Prepare a destination, local
output.write(response.content) # write contents of object to named local file
output.close() # close the connection
Some ways to verify:
! cat winequality-red.csv
, observe the output. ! type winequality-red.csv
to list the file contents! cat winequality-red.csv
# your code here
# your code here
# your code here
# your code here
# your code here
# your code here
# your code here
# your code here
Quality Score | Label. |
---|---|
q>= 7 | Top |
5<q<7 | Average |
q<=5 | Low |
# your code here
# your code here
# your code here
# your code here
# your code here
Put the new histogram and the previous one next to each other and explain what you can infer by comparing them.