文章目录
一、导入Python数据科学库
from warnings import filterwarnings
filterwarnings('ignore') # 过滤警告信息
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from pandas import DataFrame, Series
from matplotlib import rcParams
from matplotlib.ticker import MaxNLocator
二、Numpy库的一些全局功能设置
np.set_printoptions(threshold = np.inf) # 解决numpy array print后不能完全显示
np.set_printoptions(suppress = True) # 若想不以科学计数显示
三、Pandas库的一些全局功能设置
1、恢复默认设置
pd.reset_option('all') # 重置所有设置,恢复默认
pd.reset_option('display.max_rows') # 重置设置,恢复默认
2、行设置
# None可以写具体的数字,写多少就显示多少
pd.set_option('display.max_rows', None) # 显示所有行
pd.options.display.max_rows = None # 显示所有行(两种方法都可以)
pd.set_option('display.max_rows', 200) # 最多显示200行
pd.options.display.max_rows = 200 # 最多显示200行(两种方法都可以)
pd.set_option('display.min_rows',