1234567891011121314151617181920212223242526272829303132 |
- # -*- coding: utf-8 -*-
- """
- @author: yq
- @time: 2024/10/31
- @desc: 一些资源初始化
- """
- import matplotlib
- matplotlib.use('Agg')
- import matplotlib.pyplot as plt
- __all__ = ['init', 'warning_ignore']
- def init():
- plt.rcParams['font.sans-serif'] = ['SimHei'] # 设置支持中文的字体
- plt.rcParams['axes.unicode_minus'] = False # 解决负号显示问题
- plt.rcParams['figure.figsize'] = (8, 8)
- plt.rcParams['figure.max_open_warning'] = 1000
- def warning_ignore():
- from pandas.core.common import SettingWithCopyWarning
- import warnings
- warnings.simplefilter(action="ignore", category=SettingWithCopyWarning)
- warnings.simplefilter(action="ignore", category=RuntimeWarning)
- if __name__ == "__main__":
- pass
|