当前位置:网站首页>动手学数据分析 数据重构
动手学数据分析 数据重构
2022-06-21 11:58:00 【includeSteven】
数据重构
介绍
在对数据做好清洗之后(重复值、缺失值),就可以对数据进行重构。为什么要进行数据重构呢,因为在实际情况下,可能数据分布在多个文件;或者数据中的某些数据是相关的,需要进行整合等;需要从数据中获取有效信息(如最值、平均值等统计信息),这个时候就需要用到数据重构的相关技术。
数据合并
DataFrame的合并
包括DataFrame的merge和join、append
使用了DataFrame对象中的merge方法,如下图:

同时,merge还可以根据索引进行合并
join:结合append可以更方便的根据索引进行合并
轴向的连接
这里有两种方式:
- 使用numpy:np.concatenat([arr, arr], axis=1)
- pd.concat():
数据的分组和聚合
数据分组
使用groupby函数
数据聚合
- sum:计算分组的总和
- mean:计算分组的平均值
- max:计算分组的最大值
References
边栏推荐
- Introduction to common source oscilloscope software and RIGOL oscilloscope upper computer software ns-scope
- 使用赞美提高绩效
- Apache ShardingSphere 5.1.2 发布|全新驱动 API + 云原生部署,打造高性能数据网关
- 记录一次pytorch训练模型遇到的报错
- Use huggingface to quickly load pre training models and datasets in the moment pool cloud
- 【yolov5s目标检测】opencv加载onnx模型在GPU上进行推理
- Understand Flink operatorchain object reuse
- SSD [target detection]
- It is the German oscilloscope software and the keysight oscilloscope upper computer software ns-scope
- 是德示波器軟件,Keysight示波器上比特機軟件NS-Scope
猜你喜欢

One article quick learning - playing with MySQL time operation function and detailed explanation of time matching operation + instance code

2022 safety officer-c certificate title and answer

马斯克的“好朋友”,冲击2022港股最大IPO

Flink调优(一)资源调优、背压问题的分析

Jenkins 通过Build periodically配置定时任务

重磅,MapStruct 1.5 发布,这次终于支持Map转为Bean了!

Adapter power supply automatic test equipment | introduction to charger ATE test system nsat-8000

是德示波器軟件,Keysight示波器上比特機軟件NS-Scope

考研政英平均分出炉!你目前什么水平?

One's deceased father grind politics English average cent furnace! What is your current level?
随机推荐
当GDPR来敲门
MySQL-DQL
6-Zabbix监控自动发现第三方中间件内存及CPU使用情况
One's deceased father grind politics English average cent furnace! What is your current level?
Apache ShardingSphere 5.1.2 发布|全新驱动 API + 云原生部署,打造高性能数据网关
Codeforces Round #797 (Div. 3) F. Shifting String题解
事务Transaction
harmonyOS第二次培训
Design and implementation of server security audit system
R&S示波器软件,罗德与施瓦茨示波器上位机软件NS-Scope介绍
[untitled]
Devsecops: s-sdlc enterprise best practices
中国企业海外业务DDoS防护探索
Clear the switch configuration, configure the image port and Wireshark packet capturing (take Huawei s5720 as an example)
Flink tuning (I) resource tuning and back pressure analysis
旅行不能治愈心灵
一文搞懂 Flink OperatorChain 对象重用
MySQL-DQL
WPF 使用 MAUI 的自绘制逻辑
TypeScript 变量声明 —— 类型断言(Type Assertion)