python DataCamp:Python数据科学简介https://www.datacamp.com/courses/intro-to-python-for-data-science

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python DataCamp:Python数据科学简介https://www.datacamp.com/courses/intro-to-python-for-data-science相关的知识,希望对你有一定的参考价值。

# heights and positions are available as lists

# Import numpy
import numpy as np

# Convert positions and heights to numpy arrays: np_positions, np_heights
np_positions = np.array(positions)
np_heights = np.array(heights)

# Heights of the goalkeepers: gk_heights
gk_heights = np_heights[np_positions == 'GK']

# Heights of the other players: other_heights
other_heights = np_heights[np_positions != 'GK']

# Print out the median height of goalkeepers. Replace 'None'
print("Median height of goalkeepers: " + str(np.median(gk_heights)))

# Print out the median height of other players. Replace 'None'
print("Median height of other players: " + str(np.median(other_heights)))

以上是关于python DataCamp:Python数据科学简介https://www.datacamp.com/courses/intro-to-python-for-data-science的主要内容,如果未能解决你的问题,请参考以下文章

python DataCamp:用于数据科学的中级Python https://www.datacamp.com/courses/intermediate-python-for-data-scienc

python DataCamp:Python数据科学工具箱(第2部分)https://www.datacamp.com/courses/python-data-science-toolbox-part

python DataCamp:用Python导入数据(第1部分)

学习笔记之Intermediate Python for Data Science | DataCamp

数据科学中R VS Python:获胜者是...

数据科学中R VS Python:获胜者是...