Code Review: Hurricane Analysis

Hi y’all!
I would love any feedback on the Python Hurricane Analysis project. This one was difficult! I ended up turning the initial lists into a pandas dataFrame and then back into a dictionary. I feel like my code could be a lot cleaner, so I would love any suggestions on that.

Here is the link to the project:

And here is a sample of the code:

# turning the lists into a dataFrame where the name of the hurricane is the index
import pandas
h_list_dict = {"Names": names,"Months": months, "Years": years, "Max Sustained Winds": max_sustained_winds, "Areas Affected": areas_affected, "Damages": updated_damages, "Deaths": deaths}
df = pandas.DataFrame(h_list_dict, index = [names])
del df["Names"]

# changing the index from names to years
df_years = pandas.DataFrame(h_list_dict, index = [years])
del df_years["Years"]

# Changing the database into a dictionary in order to perform functions 
hurricanes = df.to_dict(orient="index")

Thanks for reading!

1 Like

Yeah mate, this one actually is hard…