+1 vote
in Python by

Given a dataset of test scores, write Pandas code to return cumulative bucketed scores of <50, <75, <90, <100.

1 Answer

0 votes
by

def bucket_test_scores(df):

    bins = [0, 50, 75, 90, 100]

    labels=['<50','<75','<90' , '<100']

    df['test score'] = pd.cut(df['test score'], bins,labels=labels)

Related questions

+2 votes
asked Oct 28, 2022 in Python by SakshiSharma
0 votes
+1 vote
asked Oct 28, 2022 in Python by SakshiSharma
...