The problem statement for this task was:
The task you have to perform is “Pickling Iris.” For this, Check the UC Irvine Machine Learning Repository site to get the dataset. You can search the Iris dataset through their searchable interface. Follow the following steps to download the dataset:
After saving Iris. data file, parse it using the split() function or using a new line approach. The method of parsing is up to you.
The main task is to get the list of lists that you will pickle. And after creating the pickle, write a code to read it. For downloading the Iris dataset, use the request module.
# pickle # Use requests module to download the iris dataset import requests import pickle data = requests.get("https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data").text # print(data) # l1 = data.split("\n") # print(l1) l2 =[item.split(",") for item in data.split("\n") if len(item)!=0] # print(l2) with open("myiris.pkl", "wb") as f: pickle.dump(l2, f) # To read this pickle file you can use this code # import pickle # with open("myiris.pkl", "rb") as f: # print(pickle.load(f))
No downloadable resources for this video. If you think you need anything, please post it in the QnA!
Any Course related announcements will be posted here