Panda Fundamental

博客指出NumPy虽提供基础数据处理结构和工具,但存在局限,如不支持列名、每数组仅支持一种数据类型、缺乏常见分析模式的预建方法等。而pandas库能解决这些痛点,是NumPy的扩展,还介绍了DataFrame等相关操作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

NumPy provides fundamental structures and tools that makes working with data easier, but there are several things that limit its usefulness as a single tool when working with data:

· The lack of support for column names forces us to frame the questions we want to answer as multi-dimensional array operations.
· Support for only one data type per ndarray makes it more difficult to work with data that contains both numeric and string data.
· There are lots of low level methods, however there are many common analysis patterns that don’t have pre-built methods.
The pandas library provides solutions to all of these pain points and more. Pandas is not so much a replacement for NumPy as an extension of NumPy. The underlying code for pandas uses the NumPy library extensively, which means the concepts you’ve been learning will come in handy as you begin to learn more about pandas.

1. DataFrame.dtypes

similar to NumPy’s ndarray.dtype attribute, return information about the types of each column.
1.在这里插入图片描述
2. DataFrame.loc[] 在这里插入图片描述A是label1列和label2列的所有行;B是label1列到label2列的所有列的所有元素
shortcuts:
在这里插入图片描述
3. Series.describe() : returns some descriptive statistics on the data contained within a specific pandas series在这里插入图片描述
count: 非零数
unique:unique数
top:most common value
freq:most common value 的频率

4.add a new column:在这里插入图片描述
5. boolean indexing.在这里插入图片描述在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值