【数据分析项目实战】AB测试:去除无控制数据,shapiro,mannwhitneyu,ttest_ind

数据集介绍:10000条数据,被分为对照组和实验组,研究variant是否为revenue带来改变。

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from scipy.stats import shapiro,mannwhitneyu,ttest_ind

一、清洗数据

新增一个可复用的查看函数:
使用了f-string进行格式化

def jiben_xinxi(data,head=5): #定义一个之后都可以用的“基本信息”函数
    #等价print('shape:{}'.format(data.shape))
    print(f'Shape:{
     
     data.shape}')
    #等价print('Head'.center(70,'-'))
    #>居右,<居左,填充符号+命令+宽度
    print(f'{
     
     "Head":-^70}')
    print(data.head(head))
    print(f'{
     
     "Dtypes":-^70}')#print("Dtypes".center(70,'-'))
    print(data.dtypes)
    print(f'{
     
     "NULL":-^70}')
    print(data.isnull().sum())
    print(f'{
     
     "Describe":-^70}')
    print(data.describe().
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值