<jupyter_start><jupyter_text>Note: Parts of this homework might be quite challenging as it may not be obvious how to even search for a possible solution. Feel free to collaborate with your classmates to solve these questions. **1**. Using `requests`, read text from from `https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.names`    and write a regular expression using `re` that returns the following list```python['sepal length in cm', 'sepal width in cm', 'petal length in cm', 'petal width in cm', 'class']```<jupyter_code>import requests

x = requests.get('https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.names')
import re

ls = re.findall('sepal.*cm|petal.*cm',x.text)+[re.search('class',x.text)[0]]
ls<jupyter_output><empty_output><jupyter_text>**2**. Using `pandas`, create a DataFrame which looks like the image below (but with all rows) from`https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data'`and the columns variable created in the last question.<jupyter_code>import pandas as pd
cols = [s.replace(" ","_") for s in ls]
df = pd.read_csv('https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data')
df.columns = cols
df.head()<jupyter_output><empty_output><jupyter_text>**3**. Modify the DataFrame so that `iris` is in a column called `genus` and `setosa` etc is in a column named `species` and remove the `class` column.<jupyter_code>df[["genus","species"]] = df["class"].str.split("-",expand=True)
df = df.drop('class',axis=1)
df.dropna(inplace=True)
df
df.drop(['genus',"species"],axis=1).columns[0]<jupyter_output><empty_output><jupyter_text>**4**. Using `seaborn`, generate this plot from the DataFrame created in Q3.<jupyter_code>numeric = df.columns[0:4]
df = df.astype({numeric[0]:'float',numeric[1]:"float",numeric[2]:"float",numeric[3]:"float"})
import matplotlib.pyplot as plt
import seaborn as sns
fig, ax = plt.subplots(2,2,figsize=(10,10),sharey=True)
j=0
for i, value in enumerate(df.columns[0:4]):
    if i>1:
        j=1
    if i>1:
        i -= 2
    sns.stripplot(x='species',y=value,data=df, ax=ax[j,i])
    ax[j,i].set_ylabel("value")
    ax[j,i].set_title(value)<jupyter_output><empty_output><jupyter_text>**5**. Using `joypy`, create the following plot from the `iris` DataFrame from Q2. You may have to pip install `joypy` first.<jupyter_code>import joypy
fig, ax = joypy.joyplot(df, by="species")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.159688013136289, 'fraction_numerical': 0.012315270935960592, 'mean_word_length': 5.826330532212885, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 23, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '138213', 'license': 'MIT', 'n_tokens_mistral': 879, 'n_tokens_neox': 862, 'n_words': 215, 'path': 'exercises/Exercises_04.ipynb', 'repo_name': 'malcolmsfraser/bios823-personal', 'size': '2436'}