this is the nav!
Workspace
JITENDRA KUMAR KUMAWAT/

Introduction to Python

0
Beta

Run the hidden code cell below to import the data used in this course.

Take Notes

Add notes about the concepts you've learned and code cells with code you want to keep.

`.mfe-app-workspace-11z5vno{font-family:JetBrainsMonoNL,Menlo,Monaco,'Courier New',monospace;font-size:13px;line-height:20px;}`# Add your code snippets here``

Explore Datasets

Use the arrays imported in the first cell to explore the data and practice your skills!

• Print out the weight of the first ten baseball players.
• What is the median weight of all baseball players in the data?
• Print out the names of all players with a height greater than 80 (heights are in inches).
• Who is taller on average? Baseball players or soccer players? Keep in mind that baseball heights are stored in inches!
• The values in `soccer_shooting` are decimals. Convert them to whole numbers (e.g., 0.98 becomes 98).
• Do taller players get higher ratings? Calculate the correlation between `soccer_ratings` and `soccer_heights` to find out!
• What is the average rating for attacking players (`'A'`)?
``````import numpy as np
np_2d = np.array([[5,  6, 1, 2, 3, 4],
[4,  5, 3, 2, 1, 8],
[9, 10, 3, 7, 6, 5]])
print(np.std(np_2d[0,:]))
print(np.median(np_2d[0,:]))``````
``````import numpy as np
np_heights = np.array([[1.75,1.65,1.8,1.5],[1.56,1.70,1.4,1.29],[1.49,1.68,1.3,1.8]])
np.sort(np_heights[0])
print(np.mean(np_heights[:,0]))
print(np.median(np_heights[:,0]))``````
``````import numpy as np
x = np.array([3.6, 3.99, 3.91])
print(np.mean(x))
print(np.median(x))
print(np.std(x))``````
• AI Chat
• Code