FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError. Select only valid columns before calling the reduction. features = (features - features.mean()) / features.std()
时间: 2024-04-02 21:33:54 浏览: 167
tenon:页面可视化搭建工具。A visual dragging-and-dropping page builder base on Vue. what you see is what you get
这个警告是因为在对 DataFrame 进行聚合计算时,由于 numeric_only 参数默认为 None,会将所有列都进行计算,但有些列可能是无关的列,警告提示你在未来的版本中这种做法会引发 TypeError,建议在进行计算前选择有效的列。解决办法是在进行计算之前,先对 DataFrame 进行筛选,只选择需要计算的列。例如:features = (features['valid_col'] - features['valid_col'].mean()) / features['valid_col'].std()。
阅读全文