一款小清新的統(tǒng)計(jì)圖可視化工具


dexplot安裝
pip?install?dexplot
dexplot支持?jǐn)?shù)據(jù)介紹
支持pandas.DataFrame類格式數(shù)據(jù):
dexplot繪圖函數(shù)介紹
dxp.plotting_func(x,?#x軸映射的數(shù)據(jù)
??????????????????y,?#y軸映射數(shù)據(jù)
??????????????????data,?#繪圖依賴的Pandas?DataFrame數(shù)據(jù)
??????????????????aggfunc,?#統(tǒng)計(jì)函數(shù),min',?'max',?'mean'等
??????????????????split,?#被當(dāng)作分組的列
??????????????????row,?#row方向分面的變量
??????????????????col,?#col方向分面的變量
??????????????????orientation,?...)#垂直or水平展示
案例
只介紹部分圖形,所有的圖形繪制形式大同小異
#?bar
dxp.bar(x='neighborhood',?y='price',?data=airbnb,?aggfunc='median')

#?分組bar
dxp.bar(x='neighborhood',
????????y='price',
????????data=airbnb,
????????aggfunc='median',#求每個(gè)變量的均值,
????????split='superhost')#按superhost分組

#堆積bar
dxp.bar(x='neighborhood',
????????y='price',
????????data=airbnb,
????????aggfunc='median',
????????split='superhost',
????????split_order=['Yes',?'No'],
????????stacked=True)

#分面bar
dxp.bar(
????x='neighborhood',
????y='price',
????data=airbnb,
????aggfunc='median',
????split='superhost',
????col='property_type',??##按property_type列分面
????col_order=['House',?'Condominium',?'Apartment'],??#指定列分面順序
????row='bedrooms',??#按bedrooms行分面
????row_order=[1,?2,?3])??#指定行分面順序

#箱圖
dxp.box(x='price',
????????y='neighborhood',
????????data=airbnb,
????????split='property_type',#
????????split_order='desc')

#分面箱圖
dxp.box(x='price',
????????y='neighborhood',
????????data=airbnb,
????????split='superhost',
????????col='property_type',
????????col_order=['House',?'Condominium',?'Apartment'],
????????row='bedrooms',
????????row_order=[1,?2])

#分面kde
dxp.kde(x='price',
????????data=airbnb,
????????split='bedrooms',
????????split_order=[1,?2,?3],
????????cumulative=True,
????????col='property_type',
????????wrap=2)

#分面kde圖
dxp.kde(x='price',?y='cleaning_fee',?data=airbnb,?row='neighborhood',?wrap=3)

#堆積counts圖
dxp.count(val='neighborhood',
??????????data=airbnb,
??????????split='property_type',
??????????orientation='h',
??????????stacked=True,
??????????col='superhost')

#分面scatter圖
dxp.scatter(x='longitude',
????????????y='latitude',
????????????data=airbnb,
????????????split='neighborhood',
????????????col='bedrooms',
????????????col_order=[2,?3])

小結(jié)
優(yōu)點(diǎn):
不依賴Matplotlib、是一個(gè)非常穩(wěn)定的API; 擅長(zhǎng)繪制聚合關(guān)系(aggregation)圖及分布關(guān)系(distribution)圖。
缺點(diǎn):
支持繪制的圖形類別有限,僅僅支持以下圖形,
-?bar
-?line
-?scatter
-?count
-?box
-?violin
-?hist
-?kde
ref:https://github.com/dexplo/dexplot/

加入知識(shí)星球【我們談?wù)摂?shù)據(jù)科學(xué)】
500+小伙伴一起學(xué)習(xí)!
·?推薦閱讀?·
盤點(diǎn)2021最佳數(shù)據(jù)可視化作品
「Python實(shí)用秘技04」pdf文件批量添加文字水印
評(píng)論
圖片
表情
