第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

TypeError: 'Series' 對象不能使用帶有自定義函數的 pandas apply()

TypeError: 'Series' 對象不能使用帶有自定義函數的 pandas apply()

拉風的咖菲貓 2021-07-19 17:14:51
綁定使用 Pandas 數據框 Apply() 函數來更新具有函數的所有行。結果是一個類型錯誤----> 1 df_usnews['AvgMathSAT_IQR'].apply(interquartile(df_usnews))/anaconda/lib/python3.5/site-packages/pandas/core/series.py in apply(self, func, convert_dtype, args, **kwds)   2235             values = lib.map_infer(values, boxer)   2236 -> 2237         mapped = lib.map_infer(values, f, convert=convert_dtype)   2238         if len(mapped) and isinstance(mapped[0], Series):   2239             from pandas.core.frame import DataFramepandas/src/inference.pyx in pandas.lib.map_infer (pandas/lib.c:63043)()TypeError: 'Series' object is not callabledef interquartile(df):        return pd.to_numeric(df.ThirdQuartileMathSAT) - pd.to_numeric(df.FirstQuartileMathSAT)q75_upper = np.percentile(df_usnews.AvgMathSAT, q=75, interpolation='higher', axis=0)q25_lower = np.percentile(df_usnews.AvgMathSAT, q=25, interpolation='lower', axis=0)interquartile = q75_upper - q25_lowerdf_usnews['AvgMathSAT_IQR'] = 0df_usnews['AvgMathSAT_IQR'].apply(interquartile(df_usnews))
查看完整描述

1 回答

  • 1 回答
  • 0 關注
  • 1011 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號