Paste Search Dynamic
Recent pastes
player details
  1. import numpy as np
  2.  
  3. playerdetails = [1.9, 75.4, 1.3, 77.5,2.1, 82.5, 1.5, 74.2]
  4.  
  5. soccer = np.array(playerdetails)
  6. np_soccer = soccer.reshape(4,2)
  7.  
  8. print (np_soccer)
  9.  
  10. # Print out the shape of np_soccer
  11. print(np_soccer.shape)
  12.  
  13. #Printing the average of Heights
  14. avg = np.mean(np_soccer[:,0])
  15. print("Average: " + str(avg))
  16.  
  17. # Print median height.
  18. med = np.median(np_soccer[:,0])
  19. print("Median: " + str(med))
  20.  
  21. # Print out the standard deviation on height.
  22. stddev = np.std(np_soccer[:,0])
  23. print("Standard Deviation: " + str(stddev))
  24.  
  25. #Calculating BMI
  26. np_height = np_soccer[:,0]
  27. np_weight = np_soccer[:,1]
  28.  
  29. bmi = np_weight/np_height**2
  30. print (bmi)
  31.  
  32. arr_overweight = bmi[bmi>25]
  33. print ("Overweight players")
  34. print (arr_overweight)
  35.  
  36. arr_normal = bmi[bmi<=25]
  37.  
  38. print ("players whose bmi is normal ")
  39. print (arr_normal)
  40.  
Parsed in 0.006 seconds