Intermediate Importing Data in Python
1. Importing flat files from the web: your turn! # Import package from urllib.request import urlretrieve # Import pandas import pandas as pd # Assign url of file: url url = 'https://s3.amazonaws.com/assets.datacamp.com/production/course_1606/datasets/winequality-red.csv' # Save file locally urlretrieve(url, 'winequality-red.csv') # Read file into a DataFrame and print its head ## ('winequality-red.csv', <http.client.HTTPMessage object at 0x000000001FBF52C8>) df = pd.read_csv('winequality-red.csv', sep=';') print(df.head()) ## fixed acidity volatile acidity citric acid ... sulphates alcohol quality ## 0 7.