-
-
Save tengpeng/a439b41a1e4c935b1b22 to your computer and use it in GitHub Desktop.
test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy | |
#data = numpy.random.random(100) | |
bins = numpy.linspace(15, 100, 5) | |
group_names = ['1', '2', '3', '4','5'] | |
#digitized = numpy.digitize(df_all['age'], bins) | |
categories = pd.cut(df_all['age'], bins, labels=group_names) | |
df['categories'] = pd.cut(df['postTestScore'], bins, labels=group_names) | |
categories | |
#bin_means = [data[digitized == i].mean() for i in range(1, len(bins))] | |
#df_all['age'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment