Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SLU03 - Exercise 7 #6

Open
ixjf opened this issue Jul 21, 2024 · 0 comments
Open

SLU03 - Exercise 7 #6

ixjf opened this issue Jul 21, 2024 · 0 comments

Comments

@ixjf
Copy link

ixjf commented Jul 21, 2024

  1. The exercise asks for title "Salary Distribution by Experience Level" but the code checks for "Salary Distribution in the US".
  2. The code checks for bins [41000, 43000, ...] with:

edge_pos = sorted([(i+n*10)*1000 for i in [41,43,45,47] for n in range(0,11)]) assert sum([int(x.get_x())==e for x,e in zip(_patches,edge_pos)]), 'The bin positions are not correct.'

but:
a) this is not what is requested in the exercise (bins should go from 40000 to 160000 in steps of 10000), and
b) if the initial and final bin edge positions are correct but the remaining ones are not, the assertion will still pass. Missing sum() == val?

Additionally, I'm not sure if

assert len(pc.axis.patches)==44, 'The plot does not have the correct number of bins.'

is correct.

edge_pos above seems to suggest the bin steps should be higher, in which case == 44 makes sense. In my case, I used df.pivot.plot.hist which gives me repeated bin edges [40000, 40000, 40000, 40000, 50000, 50000, 50000, 50000, ...] because of the different experience levels. I'm not sure if this could differ by making the histogram in a different way (i.e. the edges don't show up repeated)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant