题解 | #统计鸢尾花数据分位数#
统计鸢尾花数据分位数
http://www.nowcoder.com/practice/e979d1a37b204e2e801669aba5345b04
quantile
quantitle(self, q=0.5, ...)
q: float or array-like, default 0.5 (50% quantile)If
qis an array, a DataFrame will be returned where the index isq, the columns are the columns of self, and the values are the quantiles.If
qis a float, a Series will be returned where the index is the columns of self and the values are the quantiles.
import pandas as pd
iris = pd.read_csv('iris.csv', sep=',')
df = iris.iloc[:,0:4]
print(df.quantile([0.25,0.50,0.75]))
查看11道真题和解析
