有时候运行一些旧版本代码时会有很多warning输出,如果不想这些乱糟糟的输出,我们可以使用warning模块: import warnings warnings.filterwarnings('ignore')