《Python数据分析技术栈》第06章使用 Pandas 准备数据 01 Pandas概览(Pandas at a glance)

01 Pandas概览(Pandas at a glance)

《Python数据分析技术栈》第06章使用 Pandas 准备数据 01 Pandas概览(Pandas at a glance)

Pandas概述

Wes McKinney developed the Pandas library in 2008. The name (Pandas) comes from the term “Panel Data” used in econometrics for analyzing time-series data. Pandas has many features, listed in the following, that make it a popular tool for data wrangling and analysis.

Wes McKinney 于 2008 年开发了 Pandas 库。Pandas 这个名字来源于计量经济学中用于分析时间序列数据的术语 “面板数据”。Pandas 有许多功能,这些功能使其成为数据处理和分析的常用工具。

Pandas provides features for labeling of data or indexing, which speeds up the retrieval of data.

Pandas 提供数据标签或索引功能,可加快数据检索速度。

Input and output support: Pandas provides options to read data from different file formats like JSON (JavaScript Object Notation), CSV (Comma-Separated Values), Excel, and HDF5 (Hierarchical Data Format Version 5). It can also be used to write data into databases, web services, and so on.

输入和输出支持: Pandas 提供从不同文件格式读取数据的选项,如 JSON(JavaScript Object Notation)、CSV(Comma-Separated Values)、Excel 和 HDF5(Hierarchical Data Format Version 5)。它还可用于将数据写入数据库、网络服务等。

Most of the data that is needed for analysis is not contained in a single source, and we often need to combine datasets to consolidate the data that we need for analysis. Again, Pandas comes to the rescue with tailor-made functions to combine data.

分析所需的大部分数据并不包含在单一来源中,因此我们经常需要合并数据集,以整合分析所需的数据。Pandas 又一次提供了量身定制的合并数据函数。

Speed and enhanced performance: The Pandas library is based on Cython, which combines the convenience and ease of use of Python with the speed of the C language. Cython helps to optimize performance and reduce overheads.

速度和增强的性能 Pandas 库基于 Cython,它将 Python 的方便易用与 C 语言的速度相结合。Cython 有助于优化性能和减少开销。

Data visualization: To derive insights from the data and make it presentable to the audience, viewing data using visual means is crucial, and Pandas provides a lot of built-in visualization tools using Matplotlib as the base library.

数据可视化: 要从数据中获得洞察力并将其呈现给受众,使用可视化手段查看数据至关重要,而 Pandas 使用 Matplotlib 作为基础库,提供了大量内置可视化工具。

Support for other libraries: Pandas integrates smoothly with other libraries like Numpy, Matplotlib, Scipy, and Scikit-learn. Thus we can perform other tasks like numerical computations, visualizations, statistical analysis, and machine learning in conjunction with data manipulation.

支持其他库 Pandas 可与 Numpy、Matplotlib、Scipy 和 Scikit-learn 等其他库顺利集成。因此,我们可以结合数据处理执行其他任务,如数值计算、可视化、统计分析和机器学习。

Grouping: Pandas provides support for the split-apply-combine methodology, whereby we can group our data into categories, apply separate functions on them, and combine the results.

分组: Pandas 支持 "拆分-应用-合并 "方法,我们可以将数据分组,分别应用不同的函数,然后合并结果。

Handling missing data, duplicates, and filler characters: Data often has missing values, duplicates, blank spaces, special characters (like $, &), and so on that may need to be removed or replaced. With the functions provided in Pandas, you can handle such anomalies with ease.

处理缺失数据、重复数据和填充字符: 数据中经常会有需要删除或替换的缺失值、重复数据、空白、特殊字符(如 $、&)等。利用 Pandas 提供的函数,您可以轻松处理此类异常情况。

Mathematical operations: Many numerical operations and computations can be performed in Pandas, with NumPy being used at the back end for this purpose.

数学运算 在 Pandas 中可以执行许多数值运算和计算,NumPy 在后端用于此目的。

环境准备

If you have not already installed Pandas, go to the Anaconda Prompt and enter the following command.

如果尚未安装 Pandas,请转到 Anaconda 提示符并输入以下命令。

pip install pandas

Once the Pandas library is installed, you need to import it before using its functions. In your Jupyter notebook, type the following to import this library.

安装好 Pandas 库后,在使用其功能之前需要将其导入。在 Jupyter 笔记本中,键入以下内容导入该库。

import pandas as pd

Here, pd is a shorthand name or alias that is a standard for Pandas.

这里,pd 是 Pandas 标准的速记名称或别名。

For some of the examples, we also use functions from the NumPy library. Ensure that both the Pandas and NumPy libraries are installed and imported.

在部分示例中,我们还使用了 NumPy 库中的函数。确保已安装并导入 Pandas 和 NumPy 库。

You need to download a dataset, “subset-covid-data.csv”, that contains data about the number of cases and deaths related to the COVID-19 pandemic for various countries on a particular date. Please use the following link for downloading the dataset: https://github.com/DataRepo2019/Data-files/blob/master/subset-covid-data.csv

您需要下载一个名为 "subset-covid-data.csv "的数据集,其中包含特定日期不同国家与 COVID-19 大流行相关的病例数和死亡数的数据。请使用以下链接下载数据集: https://github.com/DataRepo2019/Data-files/blob/master/subset-covid-data.csv

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/341498.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

项目工时统计成本核算管理

技术架构: Java 1.8 MySQL 8 Vue 项目基于前后端分离架构,服务端主要技术:SpringBoot 前端主要是Vue。 项目介绍: 轻量级项目工时统计系统,是目前企业进行项工时管理统计的推荐选择。 通过项目工时管理系统,可通过…

Linux--文件链接

目录 1.建立软连接 2.建立硬链接 3.什么是软链接 Linux中软链接的应用场景 4.什么是硬链接 5.文件与目录的硬链接数 6.软链接与硬链接的区别 用户无法对目录建立硬链接,可以建立软连接。 在Linux中文件的链接有两种:1.软连接 2.硬链接 1.建立软…

Docker 配置 Gitea + Drone 搭建 CI/CD 平台

Docker 配置 Gitea Drone 搭建 CI/CD 平台 配置 Gitea 服务器来管理项目版本 本文的IP地址是为了方便理解随便打的,不要乱点 首先使用 docker 搭建 Gitea 服务器,用于管理代码版本,数据库选择mysql Gitea 服务器的 docker-compose.yml 配…

RK3568 移植Ubuntu

使用ubuntu-base构建根文件系统 1、到ubuntu官网获取 ubuntu-base-18.04.5-base-arm64.tar.gz Ubuntu Base 18.04.5 LTS (Bionic Beaver) 2、将获取的文件拷贝到ubuntu虚拟机,新建目录,并解压 mkdir ubuntu_rootfs sudo tar -xpf u

用flinkcdc debezium来捕获数据库的删除内容

我在用flinkcdc把数据从sqlserver写到doris 正常情况下sqlserver有删除数据,doris是能捕获到并很快同步删除的。 但是我现在情况是doris做为数仓,数据写到ods,ods的数据还会通过flink计算后写入dwd层,所以此时ods的数据是删除了…

SPN 泄露 | 扫描 | 维护

SPN 泄露 当Service Principal Names(SPNs)泄露时,可能会引发严重的安全风险,特别是在使用Kerberos身份验证的环境中。 身份欺骗(Identity Spoofing): 攻击者可以用泄露的SPN来伪装成合法的服…

芯驰E3340软件编译以及更新步骤

打开已有工程File->Open Solution: 东南项目:e3340\boards\e3_324_ref_display\proj\jetour-t1n-fl3\sf\SES 编译:build->build sf 增加头文件和宏定义: 编译完成sf后,进行编译bootloader 东南项目:e3340\boa…

Java Server-Sent Events通信

Server-Sent Events特点与优势 后端可以向前端发送信息,类似于websocket,但是websocket是双向通信,但是sse为单向通信,服务器只能向客户端发送文本信息,效率比websocket高。 单向通信:SSE只支持服务器到客…

go语言(十四)----反射

变量的结构 2 举个例子 package mainimport "fmt"type Reader interface {ReadBook() }type Writer interface {WriteBook() }//具体类型 type Book struct {}func (this *Book) ReadBook() {fmt.Println("Read a Book")}func (this *Book) WriteBook() {…

​《WebKit 技术内幕》学习之九(3): JavaScript引擎

3 JavaScriptCore引擎 3.1 原理 JavaScriptCore引擎是WebKit中的默认JavaScript引擎,也是苹果在开源WebKit项目之后,开源的另外一个重要的项目。同其他很多引擎一样,在刚开始的时候它的主要部分是一个基于抽象语法树的解释器,这…

天软特色因子看板 (2024.1 第8期)

该因子看板跟踪天软特色因子A04001(当日趋势强度,该因子为反映股价走势趋势强弱,用以刻画股价走势趋势强弱,abs(值)越接近1,趋势 性越强,符号代表涨跌方向。 今日为该因子跟踪第8期,跟踪其在SW801080 (申万…

什么是WAF

WAF是Web应用防火墙(Web Application Firewall)的简称,是一款通过执行一系列针对HTTP/HTTPS的安全策略来专门为Web应用提供保护的产品。 WAF主要用于防御Web应用攻击,例如SQL注入、跨站脚本攻击(XSS)、网页…

Java--接口

文章目录 主要内容一.teacher&student1.源代码代码如下(示例): 2.结果 二.shape1.源代码代码如下(示例): 2.结果 三.生物、动物、人1.源代码代码如下(示例): 2.结果 总结 主要内容 一.teacher&stu…

开源项目CuteSqlite开发笔记(八):Windows 64位/32位使用GetWindowLongPtr钩子函数

需求描述 在开发CuteSqlite的时候, 有一个功能需要实现,鼠标移到WTL::CStatic上后,发送消息通知CToolTipCtrl弹出。 遇到问题 WTL::CStatic控件没有相应 WM_MOUSEMOVE 消息,需要返回一个HTCLIENT消息来让窗口处理函数执行 WM_MO…

web3:B站chainlink课程第五课Wsl安装ubuntu虚拟机

坑了我好久。 https://learn.microsoft.com/zh-cn/windows/wsl/install-manual 按照微软给的这个手动安装的方式来,别想在线了,反正来看这个的肯定是直接 wsl --install成功不了的选手。 注意! 步骤6别从Microsoft Store 下载,…

C#winform上位机开发学习笔记9-串口助手的多窗体功能添加

1.功能描述 涉及子窗体的创建过程,子窗体的调用操作,子窗体与主窗体的显示位置设置,子窗体随主窗体移动 2.代码部分 步骤1:新建button并修改Text 步骤2:在现工程中新建项目 步骤3:选择窗体修改窗体名称 …

SCCB接口

文章目录 概述引脚传输时序起始/结束信号三线模式两线模式 传输周期3阶段写传输周期2阶段写传输周期2阶段读传输周期阶段一 ID Address阶段二 子地址/读数据阶段三 写数据 SCCB与IIC区别未完待续(还有代码)... 概述 SCCB(Serial Camera Control Bus&…

【极数系列】Flink 初相识(01)

# 【极数系列】Flink 初相识(01) 引言 Flink官网:https://flink.apache.org/ Flink版本:https://flink.apache.org/blog/ Flink文档:https://ci.apache.org/projects/flink/flink-docs-release-1.12/ Flink代码库…

Redis(五)管道

文章目录 官网总结Pipeline与原生批量命令对比Pipeline与事务对比使用Pipeline注意事项 官网 https://redis.io/docs/manual/pipelining/ Pipeline是为了解决RTT往返回时,仅仅是将命令打包一次性发送对整个Redis的执行不造成其它任何影响 总结 Pipeline与原生批量…

Med-YOLO:3D + 医学影像 + 检测框架

Med-YOLO:3D 医学影像 检测框架 提出背景设计思路网络设计训练设计讨论分析 魔改代码:加强小目标检测总结 提出背景 论文链接:https://arxiv.org/abs/2312.07729 代码链接:https://github.com/JDSobek/MedYOLO 提出背景&…
最新文章