5000 行的数据帧。...还可以使用 skiprows 参数从文件末尾选择行。Skiprows=5000 表示我们将在读取 csv 文件时跳过前 5000 行。...df.dropna(axis=0, how='any', inplace=True)
9.根据条件选择行
在某些情况下,我们需要适合某些条件的观测值(即行)
france_churn = df[(df.Geography...df[['Geography','Exited','Balance']].sample(n=6).reset_index(drop=True)
17.将特定列设置为索引
我们可以将数据帧中的任何列设置为索引...ser= pd.Series([2,4,5,6,72,4,6,72])
ser.pct_change()
29.基于字符串的筛选
我们可能需要根据文本数据(如客户名称)筛选观测值(行)。