python建立数据库索引_在python中建立索引并选择数据

python建立数据库索引

介绍 (Introduction)

The Python and NumPy indexing operators [] and attribute operator ‘.’ (dot) provide quick and easy access to pandas data structures across a wide range of use cases. The index is like an address, that’s how any data point across the data frame or series can be accessed. Rows and columns both have indexes.

Python和NumPy索引运算符[]和属性运算符'。 (点)可在各种用例中快速轻松地访问熊猫数据结构。 索引就像一个地址,这就是如何访问数据帧或系列中的任何数据点。 行和列都有索引。

The axis labeling information in pandas objects serves many purposes:

pandas对象中的轴标签信息有许多用途:

  • Identifies data (i.e. provides metadata) using known indicators, important for analysis, visualization, and interactive console display.

    使用已知的指标标识数据(即提供元数据),这对于分析,可视化和交互式控制台显示很重要。
  • Enables automatic and explicit data alignment.

    启用自动和显式数据对齐。
  • Allows intuitive getting and setting of subsets of the data set.

    允许直观地获取和设置数据集的子集。

索引和选择数据的不同选择 (Different Choices for indexing and selecting data)

Object selection has had several user-requested additions to support more explicit location-based indexing. Pandas now support three types of multi-axis indexing for selecting data.

对象选择具有一些用户请求的添加项,以支持更明确的基于位置的索引。 熊猫现在支持三种类型的多轴索引来选择数据。

# import the pandas library and aliasing as pd import pandas as pd import numpy as np df = pd.DataFrame(np.random.randn(6, 3), index = ['a','b','c','d','e','f'], columns = ['A', 'B', 'C'])
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值