数据分析——从入门到精通(十三)

import numpy as np
import pandas as pd 
from pandas import Series,DataFrame

import matplotlib.pyplot as plt

# 当前文档显示matplotlib的图像:可视化
%matplotlib inline
s1 = Series(np.random.randint(100,150,size=20))
s1
0     127
1     124
2     143
3     139
4     139
5     145
6     147
7     132
8     106
9     117
10    123
11    136
12    113
13    118
14    141
15    131
16    109
17    149
18    136
19    101
dtype: int32
s1.plot()
<matplotlib.axes._subplots.AxesSubplot at 0x22ed370>

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-CzhLzC3s-1649513950055)(output_2_1.png)]

df1 = DataFrame(np.random.randint(0,100,size=(20,3)),columns=['SQLite','Oracle','MySQL'])
df1
SQLiteOracleMySQL
045549
152630
2449735
3495195
4355127
5508073
6891722
7873215
8329360
9541254
1079321
11819981
12328047
13423427
1457398
1549078
16156613
1765665
1845799
19539824
df1.plot()
<matplotlib.axes._subplots.AxesSubplot at 0x1878550>

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-s81LUfLq-1649513950056)(output_4_1.png)]

# 按照SQLite排序
df1.sort_values('SQLite')
SQLiteOracleMySQL
1079321
16156613
8329360
12328047
4355127
13423427
2449735
045549
1845799
3495195
1549078
5508073
152630
19539824
9541254
1457398
1765665
11819981
7873215
6891722
df1.sort_values('SQLite',ascending=False)
SQLiteOracleMySQL
6891722
7873215
11819981
1765665
1457398
9541254
19539824
152630
5508073
3495195
1549078
1845799
045549
2449735
13423427
4355127
12328047
8329360
16156613
1079321
df1.sort_values('SQLite',ascending=False).plot()
<matplotlib.axes._subplots.AxesSubplot at 0x1907cd0>

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-OcAxULEB-1649513950058)(output_7_1.png)]

df1.sort_values('SQLite',ascending=False).reset_index(drop=True).plot()
<matplotlib.axes._subplots.AxesSubplot at 0x6862c30>

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-kF0L9edb-1649513950059)(output_8_1.png)]

# 多列排序
df1.sort_values(['SQLite','Oracle'],ascending=False).reset_index(drop=True).plot()
<matplotlib.axes._subplots.AxesSubplot at 0x7ba0eb0>

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-fYP1aEJJ-1649513950060)(output_9_1.png)]

df1.sort_values(['SQLite','Oracle'],ascending=False).reset_index(drop=True)[['SQLite','Oracle']].plot()
<matplotlib.axes._subplots.AxesSubplot at 0x9598870>

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-HBIEFtZ2-1649513950062)(output_10_1.png)]

df1.plot()     # 绘制线型图,返回的是一个子画布对象
<matplotlib.axes._subplots.AxesSubplot at 0x962ae10>

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-o1LPu8GI-1649513950064)(output_11_1.png)]

柱状图

  • kind=‘bar’ 垂直方向
  • kind=‘barh’ 水平方向
s1.plot()
<matplotlib.axes._subplots.AxesSubplot at 0x969f7f0>

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-ME2DG2i7-1649513950065)(output_13_1.png)]

s1.plot(kind='bar')
<matplotlib.axes._subplots.AxesSubplot at 0x975faf0>

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-iXAHEUZP-1649513950066)(output_14_1.png)]

s1.plot(kind='bar',colormap='rainbow')
<matplotlib.axes._subplots.AxesSubplot at 0x9842dd0>

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-7nPwGhc7-1649513950067)(output_15_1.png)]

from matplotlib.colors import ListedColormap
# 自定义加三种颜色
cm1 = ListedColormap([np.random.uniform(0,1,size=3) for i in range(3)])
# 自定义加三种颜色
cm2 = ListedColormap(['red','blue','green'])
s1.plot(kind='bar',colormap=cm1)
<matplotlib.axes._subplots.AxesSubplot at 0xa1a1bb0>

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-wc9mXHrv-1649513950068)(output_17_1.png)]

s1.plot(kind='bar',colormap=cm2)
<matplotlib.axes._subplots.AxesSubplot at 0xa27f190>

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-zHkLP9Pp-1649513950070)(output_18_1.png)]

df1
SQLiteOracleMySQL
045549
152630
2449735
3495195
4355127
5508073
6891722
7873215
8329360
9541254
1079321
11819981
12328047
13423427
1457398
1549078
16156613
1765665
1845799
19539824
df1.plot(kind='bar')
<matplotlib.axes._subplots.AxesSubplot at 0xa3a1bb0>

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-nEDuM3mM-1649513950071)(output_20_1.png)]

df1.plot(kind='bar',colormap=cm1)
<matplotlib.axes._subplots.AxesSubplot at 0xb4ece90>

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-Roc2S9Hp-1649513950072)(output_21_1.png)]

df1.plot(kind='bar',colormap=cm2)
<matplotlib.axes._subplots.AxesSubplot at 0xb5a4650>

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-2DwriuAu-1649513950075)(output_22_1.png)]

# 解决matplotlib的中文乱码问题
plt.rcParams['font.sans-serif'] = ['SimHei']
# 解决坐标轴的刻度乱码问题
plt.rcParams['axes.unicode_minus'] = False
df1.plot(kind='bar',colormap=cm2,title='20位同学的期中考试成绩')
<matplotlib.axes._subplots.AxesSubplot at 0xb7c54b0>

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-p6ZrvjVm-1649513950075)(output_24_1.png)]

df1.plot(kind='bar',colormap=cm2,title='20位同学的期中考试成绩',fontsize=20)
<matplotlib.axes._subplots.AxesSubplot at 0xb9360b0>

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-75UycVmj-1649513950077)(output_25_1.png)]

ax = df1.plot(kind='bar',colormap=cm2,title='20位同学的期中考试成绩',fontsize=20)

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-IrSqv6t1-1649513950078)(output_26_0.png)]

# 判断ax是否有"set_title"的属性
hasattr(ax,'set_title')
True
# 判断ax里面是否有"title"的属性
hasattr(ax,'title')
True
ax.title
Text(0.5, 1, '20位同学的期中考试成绩')
# 查看ax.title的position的位置
ax.title.get_position()
(0.5, 1)
# 查看ax.title的所有属性
dir(ax.title)
['__class__',
 '__delattr__',
 '__dict__',
 '__dir__',
 '__doc__',
 '__eq__',
 '__format__',
 '__ge__',
 '__getattribute__',
 '__getstate__',
 '__gt__',
 '__hash__',
 '__init__',
 '__init_subclass__',
 '__le__',
 '__lt__',
 '__module__',
 '__ne__',
 '__new__',
 '__reduce__',
 '__reduce_ex__',
 '__repr__',
 '__setattr__',
 '__sizeof__',
 '__str__',
 '__subclasshook__',
 '__weakref__',
 '_agg_filter',
 '_alias_map',
 '_alpha',
 '_animated',
 '_axes',
 '_bbox_patch',
 '_cached',
 '_clipon',
 '_clippath',
 '_color',
 '_contains',
 '_draw_bbox',
 '_fontproperties',
 '_get_clipping_extent_bbox',
 '_get_dist_to_box',
 '_get_layout',
 '_get_multialignment',
 '_get_rendered_text_width',
 '_get_wrap_line_width',
 '_get_wrapped_text',
 '_get_xy_display',
 '_gid',
 '_horizontalalignment',
 '_in_layout',
 '_label',
 '_linespacing',
 '_mouseover',
 '_multialignment',
 '_oid',
 '_path_effects',
 '_picker',
 '_preprocess_math',
 '_prop_order',
 '_propobservers',
 '_rasterized',
 '_remove_method',
 '_renderer',
 '_rotation',
 '_rotation_mode',
 '_set_gc_clip',
 '_sketch',
 '_snap',
 '_stale',
 '_sticky_edges',
 '_text',
 '_transform',
 '_transformSet',
 '_update_clip_properties',
 '_url',
 '_usetex',
 '_verticalalignment',
 '_visible',
 '_wrap',
 '_x',
 '_y',
 'add_callback',
 'aname',
 'axes',
 'clipbox',
 'contains',
 'convert_xunits',
 'convert_yunits',
 'draw',
 'eventson',
 'figure',
 'findobj',
 'format_cursor_data',
 'get_agg_filter',
 'get_alpha',
 'get_animated',
 'get_bbox_patch',
 'get_c',
 'get_children',
 'get_clip_box',
 'get_clip_on',
 'get_clip_path',
 'get_color',
 'get_contains',
 'get_cursor_data',
 'get_family',
 'get_figure',
 'get_font_properties',
 'get_fontfamily',
 'get_fontname',
 'get_fontproperties',
 'get_fontsize',
 'get_fontstyle',
 'get_fontvariant',
 'get_fontweight',
 'get_gid',
 'get_ha',
 'get_horizontalalignment',
 'get_in_layout',
 'get_label',
 'get_name',
 'get_path_effects',
 'get_picker',
 'get_position',
 'get_prop_tup',
 'get_rasterized',
 'get_rotation',
 'get_rotation_mode',
 'get_size',
 'get_sketch_params',
 'get_snap',
 'get_stretch',
 'get_style',
 'get_text',
 'get_tightbbox',
 'get_transform',
 'get_transformed_clip_path_and_affine',
 'get_unitless_position',
 'get_url',
 'get_usetex',
 'get_va',
 'get_variant',
 'get_verticalalignment',
 'get_visible',
 'get_weight',
 'get_window_extent',
 'get_wrap',
 'get_zorder',
 'have_units',
 'is_math_text',
 'is_transform_set',
 'mouseover',
 'pchanged',
 'pick',
 'pickable',
 'properties',
 'remove',
 'remove_callback',
 'set',
 'set_agg_filter',
 'set_alpha',
 'set_animated',
 'set_backgroundcolor',
 'set_bbox',
 'set_c',
 'set_clip_box',
 'set_clip_on',
 'set_clip_path',
 'set_color',
 'set_contains',
 'set_family',
 'set_figure',
 'set_font_properties',
 'set_fontfamily',
 'set_fontname',
 'set_fontproperties',
 'set_fontsize',
 'set_fontstretch',
 'set_fontstyle',
 'set_fontvariant',
 'set_fontweight',
 'set_gid',
 'set_ha',
 'set_horizontalalignment',
 'set_in_layout',
 'set_label',
 'set_linespacing',
 'set_ma',
 'set_multialignment',
 'set_name',
 'set_path_effects',
 'set_picker',
 'set_position',
 'set_rasterized',
 'set_rotation',
 'set_rotation_mode',
 'set_size',
 'set_sketch_params',
 'set_snap',
 'set_stretch',
 'set_style',
 'set_text',
 'set_transform',
 'set_url',
 'set_usetex',
 'set_va',
 'set_variant',
 'set_verticalalignment',
 'set_visible',
 'set_weight',
 'set_wrap',
 'set_x',
 'set_y',
 'set_zorder',
 'stale',
 'stale_callback',
 'sticky_edges',
 'update',
 'update_bbox_position_size',
 'update_from',
 'zorder']
# 去掉以"_"开头的属性
[attr for attr in dir(ax.title) if not attr.startswith('_')]
['add_callback',
 'aname',
 'axes',
 'clipbox',
 'contains',
 'convert_xunits',
 'convert_yunits',
 'draw',
 'eventson',
 'figure',
 'findobj',
 'format_cursor_data',
 'get_agg_filter',
 'get_alpha',
 'get_animated',
 'get_bbox_patch',
 'get_c',
 'get_children',
 'get_clip_box',
 'get_clip_on',
 'get_clip_path',
 'get_color',
 'get_contains',
 'get_cursor_data',
 'get_family',
 'get_figure',
 'get_font_properties',
 'get_fontfamily',
 'get_fontname',
 'get_fontproperties',
 'get_fontsize',
 'get_fontstyle',
 'get_fontvariant',
 'get_fontweight',
 'get_gid',
 'get_ha',
 'get_horizontalalignment',
 'get_in_layout',
 'get_label',
 'get_name',
 'get_path_effects',
 'get_picker',
 'get_position',
 'get_prop_tup',
 'get_rasterized',
 'get_rotation',
 'get_rotation_mode',
 'get_size',
 'get_sketch_params',
 'get_snap',
 'get_stretch',
 'get_style',
 'get_text',
 'get_tightbbox',
 'get_transform',
 'get_transformed_clip_path_and_affine',
 'get_unitless_position',
 'get_url',
 'get_usetex',
 'get_va',
 'get_variant',
 'get_verticalalignment',
 'get_visible',
 'get_weight',
 'get_window_extent',
 'get_wrap',
 'get_zorder',
 'have_units',
 'is_math_text',
 'is_transform_set',
 'mouseover',
 'pchanged',
 'pick',
 'pickable',
 'properties',
 'remove',
 'remove_callback',
 'set',
 'set_agg_filter',
 'set_alpha',
 'set_animated',
 'set_backgroundcolor',
 'set_bbox',
 'set_c',
 'set_clip_box',
 'set_clip_on',
 'set_clip_path',
 'set_color',
 'set_contains',
 'set_family',
 'set_figure',
 'set_font_properties',
 'set_fontfamily',
 'set_fontname',
 'set_fontproperties',
 'set_fontsize',
 'set_fontstretch',
 'set_fontstyle',
 'set_fontvariant',
 'set_fontweight',
 'set_gid',
 'set_ha',
 'set_horizontalalignment',
 'set_in_layout',
 'set_label',
 'set_linespacing',
 'set_ma',
 'set_multialignment',
 'set_name',
 'set_path_effects',
 'set_picker',
 'set_position',
 'set_rasterized',
 'set_rotation',
 'set_rotation_mode',
 'set_size',
 'set_sketch_params',
 'set_snap',
 'set_stretch',
 'set_style',
 'set_text',
 'set_transform',
 'set_url',
 'set_usetex',
 'set_va',
 'set_variant',
 'set_verticalalignment',
 'set_visible',
 'set_weight',
 'set_wrap',
 'set_x',
 'set_y',
 'set_zorder',
 'stale',
 'stale_callback',
 'sticky_edges',
 'update',
 'update_bbox_position_size',
 'update_from',
 'zorder']
# 调整标题的字体大小
ax = df1.plot(kind='bar',colormap=cm2,title='20位同学的期中考试成绩',fontsize=20)
ax.title.set_size(20)
plt.show()

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-9kQw1nPx-1649513950080)(output_33_0.png)]

ax = df1.plot(kind='bar',colormap=cm2,title='20位同学的期中考试成绩',fontsize=20)
ax.title.set_size(20)
ax.title.set_position((0.5,1,1))  # 0.5指居中的位置
plt.show()

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-8gD8Dq8s-1649513950082)(output_34_0.png)]

fig,axes = plt.subplots(2,1,figsize=(8,10))   # figsize=(8,10) 画布大小
s1.plot(kind='bar',ax=axes[0],title='图1')   # 插入子画布1
s1.plot(kind='barh',ax=axes[1],title='图2')  # 插入子画布2
plt.show()    # 显示绘制的画布

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-bfxHB3Kg-1649513950082)(output_35_0.png)]

df1.plot(kind='bar')
<matplotlib.axes._subplots.AxesSubplot at 0xbfe0930>

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-yAQH7PN2-1649513950087)(output_36_1.png)]

# 设置画布大小
fig, axes = plt.subplots(figsize=(10,6))
df1.plot(kind='bar',ax=axes)   # 只有一个子画布时,不需要索引操作
<matplotlib.axes._subplots.AxesSubplot at 0xc22da50>

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-HUZZrz9k-1649513950088)(output_37_1.png)]

# 设置画布大小
fig, axes = plt.subplots(figsize=(10,6))
# stacked 堆栈的方式,bool值
df1.plot(kind='bar',ax=axes,stacked=True)   # 只有一个子画布时,不需要索引操作
<matplotlib.axes._subplots.AxesSubplot at 0xbb404b0>

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-NydTGifD-1649513950091)(output_38_1.png)]

直方图或密度图

  • .hist(bins=10,alpha=0.5,color=“gray”,normed|density=True)
  • .plot(kind=kde)
s1.hist()
<matplotlib.axes._subplots.AxesSubplot at 0xbbedc30>

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-9cVCUvWN-1649513950092)(output_40_1.png)]

s1.hist(bins=20) # bins=20 柱子放20个
<matplotlib.axes._subplots.AxesSubplot at 0xbbb66b0>

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-bScpTIkR-1649513950095)(output_41_1.png)]

s1.hist(bins=2)
<matplotlib.axes._subplots.AxesSubplot at 0xc495690>

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-7aphhtuw-1649513950096)(output_42_1.png)]

s1.sort_values()
19    101
8     106
16    109
12    113
9     117
13    118
10    123
1     124
0     127
15    131
7     132
18    136
11    136
3     139
4     139
14    141
2     143
5     145
6     147
17    149
dtype: int32
s2 = Series(np.random.randn(100))
s2.hist()
<matplotlib.axes._subplots.AxesSubplot at 0xc535c30>

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-xN5cQhJy-1649513950099)(output_44_1.png)]

s2 = Series(np.random.randn(100))
s2.hist(bins=50)
<matplotlib.axes._subplots.AxesSubplot at 0xc58ca90>

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-NjEXMvso-1649513950101)(output_45_1.png)]

s2 = Series(np.random.randn(100))
s2.hist(bins=50)
s2.plot(kind='kde',color='red')
<matplotlib.axes._subplots.AxesSubplot at 0xd720070>

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-pZrlHrJa-1649513950102)(output_46_1.png)]

s2 = Series(np.random.randn(100))
s2.hist(bins=50,alpha=0.3,density=True)   # 将直方的数值转化为密度值
s2.plot(kind='kde',color='red')
<matplotlib.axes._subplots.AxesSubplot at 0xc3ad670>

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-JfwdWRuz-1649513950104)(output_47_1.png)]

散点图

  • plt.scatter(x,y,marksize=50,color=)
  • dataframe.plot(x列,y列,kind=‘scatter’)
  • pd.plotting.scatter_maxtrix(frame,ax,diagonal=‘hist|kde’,s=50,c=‘’) 散点矩阵图
df1
SQLiteOracleMySQL
045549
152630
2449735
3495195
4355127
5508073
6891722
7873215
8329360
9541254
1079321
11819981
12328047
13423427
1457398
1549078
16156613
1765665
1845799
19539824
# 查看SQLite,Oracle的关系
df1.plot('SQLite','Oracle')
<matplotlib.axes._subplots.AxesSubplot at 0xd7b91b0>

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-TiSdPHq7-1649513950106)(output_50_1.png)]

# 查看SQLite,Oracle的关系,散点图
df1.plot('SQLite','Oracle',kind='scatter')
<matplotlib.axes._subplots.AxesSubplot at 0xd7fae90>

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-56gE7tdb-1649513950108)(output_51_1.png)]

# 查看Oracle,MySQL的关系,散点图
df1.plot('Oracle','MySQL',kind='scatter')
<matplotlib.axes._subplots.AxesSubplot at 0xd832c50>

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-BsE2ikE7-1649513950110)(output_52_1.png)]

plt.scatter(df1.MySQL,df1.Oracle)
<matplotlib.collections.PathCollection at 0xd8af3f0>

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-6NUe6aQx-1649513950111)(output_53_1.png)]

plt.scatter(df1.MySQL,df1.Oracle,s=100)
<matplotlib.collections.PathCollection at 0xd7fa090>

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-jTS7dsEf-1649513950114)(output_54_1.png)]

plt.scatter(df1.MySQL,df1.Oracle,s=100,c='r')  # s指大小,c指颜色
<matplotlib.collections.PathCollection at 0xd995bb0>

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-zHHct7vM-1649513950117)(output_55_1.png)]

plt.scatter(df1.MySQL,df1.Oracle,s=100,c='k')  # c='k' 中 k ----->blank 黑色
<matplotlib.collections.PathCollection at 0xda0f6d0>

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-lKeHFiGd-1649513950118)(output_56_1.png)]

pd.plotting.scatter_matrix(df1,diagonal='hist') # diagonal='hist'直方图
array([[<matplotlib.axes._subplots.AxesSubplot object at 0x0DA2A610>,
        <matplotlib.axes._subplots.AxesSubplot object at 0x0DC02AB0>,
        <matplotlib.axes._subplots.AxesSubplot object at 0x0DC26B50>],
       [<matplotlib.axes._subplots.AxesSubplot object at 0x0DC45C30>,
        <matplotlib.axes._subplots.AxesSubplot object at 0x0DC66D10>,
        <matplotlib.axes._subplots.AxesSubplot object at 0x0DC86DF0>],
       [<matplotlib.axes._subplots.AxesSubplot object at 0x0DCA6ED0>,
        <matplotlib.axes._subplots.AxesSubplot object at 0x0DCC8FB0>,
        <matplotlib.axes._subplots.AxesSubplot object at 0x0DCD3570>]],
      dtype=object)

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-c5u7v5XO-1649513950119)(output_57_1.png)]

pd.plotting.scatter_matrix(df1,diagonal='kde')  # diagonal='kde'密度图
array([[<matplotlib.axes._subplots.AxesSubplot object at 0x0DA1A930>,
        <matplotlib.axes._subplots.AxesSubplot object at 0x0E58BA10>,
        <matplotlib.axes._subplots.AxesSubplot object at 0x0E5A8AF0>],
       [<matplotlib.axes._subplots.AxesSubplot object at 0x0E5C8BD0>,
        <matplotlib.axes._subplots.AxesSubplot object at 0x0E5E8CB0>,
        <matplotlib.axes._subplots.AxesSubplot object at 0x0E609D90>],
       [<matplotlib.axes._subplots.AxesSubplot object at 0x0E62AEF0>,
        <matplotlib.axes._subplots.AxesSubplot object at 0x0E64C9B0>,
        <matplotlib.axes._subplots.AxesSubplot object at 0x0E64CF50>]],
      dtype=object)

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-M79WVbVm-1649513950122)(output_58_1.png)]

pd.plotting.scatter_matrix(df1,diagonal='kde',c='r')
array([[<matplotlib.axes._subplots.AxesSubplot object at 0x0E578E10>,
        <matplotlib.axes._subplots.AxesSubplot object at 0x0F6F2BB0>,
        <matplotlib.axes._subplots.AxesSubplot object at 0x0F70EC90>],
       [<matplotlib.axes._subplots.AxesSubplot object at 0x0F72FD70>,
        <matplotlib.axes._subplots.AxesSubplot object at 0x0F74EE50>,
        <matplotlib.axes._subplots.AxesSubplot object at 0x0F76FF30>],
       [<matplotlib.axes._subplots.AxesSubplot object at 0x0F78FA70>,
        <matplotlib.axes._subplots.AxesSubplot object at 0x0F7B1B50>,
        <matplotlib.axes._subplots.AxesSubplot object at 0x0F7BC0F0>]],
      dtype=object)

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-seBbu5Hi-1649513950123)(output_59_1.png)]

pd.plotting.scatter_matrix(df1,diagonal='kde',c='r',s=80)
array([[<matplotlib.axes._subplots.AxesSubplot object at 0x0E6E0CD0>,
        <matplotlib.axes._subplots.AxesSubplot object at 0x0F87AD90>,
        <matplotlib.axes._subplots.AxesSubplot object at 0x0F8A4E50>],
       [<matplotlib.axes._subplots.AxesSubplot object at 0x0F8C2F30>,
        <matplotlib.axes._subplots.AxesSubplot object at 0x0F8E3A70>,
        <matplotlib.axes._subplots.AxesSubplot object at 0x0F902B50>],
       [<matplotlib.axes._subplots.AxesSubplot object at 0x0F925C30>,
        <matplotlib.axes._subplots.AxesSubplot object at 0x0F944D10>,
        <matplotlib.axes._subplots.AxesSubplot object at 0x0F94F2D0>]],
      dtype=object)

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-1vNSt2DO-1649513950127)(output_60_1.png)]

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

今晚务必早点睡

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值