项目场景: 在利用pandas进行计算时,会出现数据类型为str而无法进行部分数值计算的情况 解决方案: 使用pandas库中的to_numeric方法 df = df.apply(pd.to_numeric)