数据集介绍: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().

最低0.47元/天 解锁文章
1万+

被折叠的 条评论
为什么被折叠?



