数据处理 笔记

数据处理 : 
    算子 map filter  groupby  apply 
数据切片


pandas :
    1.官网
        https://pandas.pydata.org/
    2.概述:
        pandas is a fast, powerful, flexible and easy to use open source data analysis and manipulation tool,
        【pandas就是一个数据分析的工具】
    3.编程模型【数据类型】
        1.Series
        2.DataFrame

1.Series
    1.Series is a one-dimensional labeled array 
    【Series 就是一个 一维 标签数组】
    
    2.capable of holding any data type 【integers, strings, floating point numbers, Python objects, etc.).】
        【存各种数据类型】
    3.The axis labels are collectively referred to as the index
        标签 就是索引  【可以用索引 取Series元素】

    实例化:

2.df 
    1.DataFrame is a 2-dimensional labeled data structure with columns of potentially different types
        【DataFrame 就是一个 二维 标签数组,多个不同数据类型的列】
        【 index (row labels) and columns 】

        【【DataFrame就是一个table  有行有列】
    2.如何创建df :
        Dict of 1D ndarrays, lists, dicts, or Series
        2-D numpy.ndarray
        Structured or record ndarray
        A Series
        Another DataFrame 
        【df 可以由多种数据 转化而来】
    
    3.a dict of Series objects
    

    df =》 table =》 有行有列 
    
    DataFrame = DataFrame【Series】

    实例化:

总结:
    1.df 就是table  
    2.Series 是一个table 就一个列 没有列名
    3.df = df [Series + 列名]


思考: 
    数据分析师 拿到一个数据一般做哪些事情? 【大数据工程师也是一样】
        1.数据加载 source 
        2.数据分析 transform 
        3.数据输出 sink

df 基本操作: 
    1.数据加载 

处理的数据文件格式:
    csv json text 
    结构化数据:
        csv: 按逗号进行分割 =》 excel打开的
        json: kv 
    text:
        普通文本数据

切片:
    取值

先练习一下上午讲的内容


filter : 


a=> b=> c 

select 

ifnull(name,0) as name_etl

from table 
where 
    name is null 
        is not null 


id name age  score  

select 
name,
sum(score) as score_all
from table 
group by 
name ;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值