Skip to content

Instantly share code, notes, and snippets.

@Olshansk
Last active May 25, 2020 23:25
Show Gist options
  • Select an option

  • Save Olshansk/3987754546ad715fe32015c9078aa26f to your computer and use it in GitHub Desktop.

Select an option

Save Olshansk/3987754546ad715fe32015c9078aa26f to your computer and use it in GitHub Desktop.
Joint Probability Matrix - Counts To Percentages
axis = np.linspace(5, 105, NUM_BINS + 1)[:-1]
jp_df = pd.DataFrame(jp_matrix, columns=axis, index=axis)
jp_df = jp_df.applymap(lambda val: 0 if math.isnan(val) else (val / NUM_STUDENTS))
jp_df
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment