python,tableau数据分析新手教程
数据源
成品预览
数据清洗
import pandas as pd
import numpy as np
from pandas import Series,DataFrame
baby=pd.read_csv('C:/Users/28269/Desktop/(sample)sam_tianchi_mum_baby.csv')
print(baby.head())
print(baby.shape)
# baby[baby.duplicated()]#数据无重复
# baby.dropna()#数据无空值
# baby_g = baby.groupby('gender')
# baby_g.count()#不同性别人数查得有三种性别
baby_clean=baby[baby['gender']!=2]#查得有三种性别,过滤代表未知性别的2
baby_t=pd.read_csv('C:/Users/28269/Desktop/(sample)sam_tianchi_mum_baby_trade_history.csv')
print(baby_t