使用Python读取xlsx表格数据并导入到MySQL数据库中时遇到的问题

1年前 (2024-05-15)807
使用Python读取xlsx表格数据并导入到MySQL数据库中时遇到的问题
一、读取的数据中存在nan的值,如何转换为空字符串 1、第一种方式是判断如果为nan,修改nan的值 import numpy as np nan = float('nan') print(np.isnan(nan))   2、第二种方法直接将nan替换为空字符串 i...

测试paddle和pytorch运行在cpu还是gpu

1年前 (2024-05-02)1301
测试paddle和pytorch运行在cpu还是gpu
paddle和torch有时候会有版本冲突,尤其是在使用gpu的时候,选择合适的版本很重要。 以下代码是检测paddle和torch运行环境的,查看是运行在cpu还是gpu上。 import paddle paddle.utils.run_check() print(paddle.devic...