Skip to content

Instantly share code, notes, and snippets.

@tanveer-sayyed
Created February 13, 2019 08:06
Show Gist options
  • Save tanveer-sayyed/0358536b20a459f3d567b8ee30560b00 to your computer and use it in GitHub Desktop.
Save tanveer-sayyed/0358536b20a459f3d567b8ee30560b00 to your computer and use it in GitHub Desktop.
In [61]:
mean_c0 = new_df['c0'].mean() # returns a single float
median_c1 = new_df['c1'].median() # returns a single float
mode_c3 = new_df['c3'].mode() # returns a series
print('mean_c0 = ', mean_c0)
print('median_c1 = ', median_c1)
print('mode_c3[0] = ', mode_c3[0]) # 0th element: the most repeated term
Out [61]:
mean_c0 = 5.5
median_c1 = 7.0
mode_c3[0] = 10.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment