Skip to content

Two questions about assignment 1 and module 3 #28

@NiccoloGhionzoli

Description

@NiccoloGhionzoli

Hi to all of you!
I have two questions for you:
a)does your last exercise in module 3 (solutions) work? It does not recognize final_data
b)since the deadline of the first assignment ha already expired, I would like to ask you something about point 3 of ex. 4.3.5. I did like that (for the examiners: in our assignment you will also find another version of this point). The code below actually works, but I found difficult to label the boxplots for each passenger class. The order of the boxplots is uncertain, and after thinking a bit of it I realized that it might be due to the set, which is unordered. How to label them in a better way?

fig, ax1 = plt.subplots()

for c in set(titanic['class']):
x = titanic.loc[titanic['class'] == c, 'fare']
bp = plt.boxplot(x)
ax1.set_xlabel(f'{c} class')
ax1.set_ylabel('fare')
# # show plot
plt.show()

Have a nice Sunday, Niccolò

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions