美文网首页
pandas使用技巧【13】理解 index 与columns

pandas使用技巧【13】理解 index 与columns

作者: 夜雨寒山 | 来源:发表于2017-11-09 14:37 被阅读0次
    简介: 本文为了加深对DataFrame数据中的index 与columns的理解。

    (1)index 与columns都不是DataFrame的数据组成部分
    通过查看shape属性验证

    index的name

    Index的作用

    1,identification
    过滤的时候,index是不会变化的。
    2,selection
    loc,iloc,索引方法
    3,alignment
    如当两个series做计算或者合并的时候,可以起到对齐的作用

    set_index()方法

    reset_index()方法
    使用前要确保index的名字要存在。

    sort_index()方法

    附上小哥哥的视频链接Data analysis in Python with pandas
    Youtube 🔗
    哔哩哔哩 🔗

    本系列文章列表
    pandas使用技巧总览

    相关文章

      网友评论

          本文标题:pandas使用技巧【13】理解 index 与columns

          本文链接:https://www.haomeiwen.com/subject/bmwpmxtx.html