My process

### Initial Homework The process by which I complete this lab started during the homework assigned a week prior, where I worked on my process of opening and reading files. After spending a period learning about how to open and read files, working on a specific dataset allowed me to see where I didn’t understand the content, and where I didn’t need help. I came across a bit of trouble trying to access specific rows and append float values to my lists, but after a meeting with Mr. Lee, my questions were answered and that hurdle had been passed. I finished the homework with a full understanding of how to open and read files, assign them to lists, and create a dictionary defining those values. Now that I didn’t have to worry about the semantics, I began thinking on how I could average specific values of the dataset.

### Working on the Lab Itself

My initial, and correct, instinct would be to use that technique I had used in the homework of creating a list and filling it with specific flower values(example list_setosa_petal would hold all of the setosa petal length values by doing the following:

 with open("iris.csv", "r") as f:
    data = csv.DictReader(f)
    for row in data:
        if(row["species"]=="Iris-setosa"):#(repeated for each)
            list_setosa_petal.append(float(row["petal-length"]))

), and then using these lists to get to the average. I set up several lines of code to create these lists, then defined a function that would take any list and average all of its values. I then applied this general function to each of my dataset lists, and voila, I had my average petal length and sepal widths for every flower in the dataset.

Takeaways from the process

During this process, I briefly talked with Lucca Correia about how to access specific rows in the dataset, as I would later as Mr. Lee. He proved to be fairly unhelpful, but that was my own fault now his. The main thing that I take away from this process is that I should try to extrapolate on what we learn in class more. If all I take away from a unit is what is shown on the slides, I won’t have expanded my knowledge in any meaningful way. This connects to what I could have done better, which is try different things more, instead of trying to brute force through with one method that I think will work. For the next assignment I will try harder to work both with classmates and by myself to figure out the most efficient way to do the assignment!

The Results!

Finally, now that my process and takeaways have been explored, it’s time to talk about the results. Using the code explained above and handing in on Google Classroom, I came up with the following values for the averages:

  • The Petal Lengths
    1. Setosa: 1.464
    2. Versicolor: 4.26
    3. Virginia: 5.552
  • The Sepal Widths
    1. Setosa: 3.418
    2. Versicolor: 2.77
    3. Virginia: 2.974

So, based on these results, we can say that the Iris Virginia flower has the longest petals, and the Iris Setosa has the widest sepals! Here is an image of the three flowers: flowers