fork download
  1. import numpy as np
  2. def my_grader(GS=[],S=[-2,-1,0,1]):
  3. import pandas as pd
  4. from pandas import Series, DataFrame
  5. import numpy as np
  6. from string import ascii_uppercase
  7. import itertools
  8. GR=[]
  9. for i in range(0,len(GS)):
  10. GR=GR+list(GS[i])
  11. nGR=[]
  12. for i in range(0,len(GR)):
  13. nGR.append((GR[i]-mean(GR))/std(GR))
  14. SecN=list(ascii_uppercase)
  15. Sec=SecN[0:len(GR)/50]*50
  16. Sec=Sec.sort()
  17. K={'Raw Grade':GR, 'Section':Sec, 'Normalized Grade':nGR}
  18. df=DataFrame(K,columns=['Raw Grade','Section','Normalized Grade','Letter Grade'])
  19. df['Letter Grade'][df['Normalized Grade']>S[3]]='A'
  20. return df
  21. A=80+10*np.random.randn(50)
  22. B=80+10*np.random.randn(50)
  23. C=80+10*np.random.randn(50)
  24. GS=[A,B,C]
  25. my_grader(GS)# your code goes here
Runtime error #stdin #stdout #stderr 0.05s 82240KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "prog.py", line 25, in <module>
  File "prog.py", line 3, in my_grader
ImportError: No module named pandas