数据处理 | 1. 可视化空值检测
本文最后更新于 197 天前,其中的信息可能已经有所发展或是发生改变。

应用自定义包输出空值占比的可视化图形

1. 用法1如下:检测空值

# 导入自定义包
pip install kedaofx
from kedaofx import Show

# 数据
data = pd.DataFrame(
{'name': ['s1', 's2', 's3', None, None, 'a', 'a', 0, 0, 0],
 'age1': [None, 23, 24, 25, 27, 'a', 0, 0, 0, 0],
 'age2': [None, 23, 24, 25, 27, 0, 0, 0, 0, 0],
 'age3': [3, 23, 24, 25, 27, 3, 3, 4, 5, 6],
 'age4': [0, 23, 24, 25, 27, 'a', 1, 1, 1, 1]}) 

# 检测为Null的值在整个数据中的占比
Show.show_null(data)  
其中绿色为空值占比<=30%的数据,30%>橙色<=70%,红色>80%

2. 用法2如下:检测固定格式的空值

# 检测为空值在数值列(ops_int)下在整个数据中的占比
Show.show_null(data, ops_int=0)
其中绿色为空值占比<=30%的数据,30%>橙色<=70%,红色>80%
# 检测为空值在字符串列条件(ops_str)下在整个数据中的占比
Show.show_null(data, ops_str='a')
其中绿色为空值占比<=30%的数据,30%>橙色<=70%,红色>80%
# 检测为空值在数值列(ops_int)及字符串列条件(ops_str)下在整个数据中的占比
Show.show_null(data, ops_int=0, ops_str='a')
其中绿色为空值占比<=30%的数据,30%>橙色<=70%,红色>80%

评论

  1. 1年前
    2022-5-12 3:55:27

    Good day! I just wish to offer you a big thumbs up for your great information you have right
    here on this post. I am coming back to your website for more soon.

  2. 1年前
    2022-7-26 6:22:34

    Im pretty pleased to find this great site. I need to to thank you for ones time for this particularly fantastic read!! I definitely loved every little bit of it and I have you saved as a favorite to see new stuff on your blog.

  3. 1年前
    2022-7-30 21:27:17

    Can I simply say what a comfort to find someone who actually understands what they are discussing on the net. You definitely understand how to bring an issue to light and make it important. More people should check this out and understand this side of the story. I was surprised that you are not more popular since you most certainly have the gift.

  4. 1年前
    2022-9-10 12:10:38

    Thanks for your blog, nice to read. Do not stop.

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
下一篇