标签:python ams plt for bsp figure bar sns range
1、导入数据可视化的相关库文件
import pandas as pd pd.set_option(‘display.max_column‘,30) import numpy as np import statsmodels.api as sm import matplotlib.pyplot as plt import seaborn as sns sns.set() from pylab import rcParams ##matplotlib rcParams[‘figure.figsize‘] = 12, 8
2、读入数据
train = pd.read_csv(‘data/first_round_training_data.csv‘)[[‘Parameter‘+str(i) for i in range(1,11)]+[‘Quality_label‘]] test = pd.read_csv(‘data/first_round_testing_data.csv‘)
3、区分开类别特征和连续特征
理解:类别变量就是说特征取值比较少的变量,连续特征值就是说特征连续取值,所有用可视化数据的nunique()
train.nunique().plot(kind=‘bar‘)
标签:python ams plt for bsp figure bar sns range
原文地址:https://www.cnblogs.com/tyh666/p/11477899.html