SlideShare une entreprise Scribd logo
1  sur  31
Télécharger pour lire hors ligne
Programming for Data
Analysis
Week 2
Dr. Ferdin Joe John Joseph
Faculty of Information Technology
Thai – Nichi Institute of Technology, Bangkok
Today’s lesson
Faculty of Information Technology, Thai - Nichi Institute of
Technology, Bangkok
2
• Merging
• Concatenating
• Reshaping
• Laboratory
Merging
• Used in pandas to combine data from two sources
• Sources can be from same format or different
• csv and csv, csv and json, json and xml and a concoction of all these
• Similar to numpy array manipulation but effective with pandas
Faculty of Information Technology, Thai - Nichi Institute of
Technology, Bangkok
3
Function Used
concat()
Faculty of Information Technology, Thai - Nichi Institute of
Technology, Bangkok
4
Syntax of concat()
Faculty of Information Technology, Thai - Nichi Institute of
Technology, Bangkok
5
Syntax of concat()
Faculty of Information Technology, Thai - Nichi Institute of
Technology, Bangkok
6
•objs : a sequence or mapping of Series or DataFrame objects. If a dict is passed, the sorted keys will be used as the keys argument,
unless it is passed, in which case the values will be selected (see below). Any None objects will be dropped silently unless they are all
None in which case a ValueError will be raised.
•axis : {0, 1, …}, default 0. The axis to concatenate along.
Syntax of concat()
Faculty of Information Technology, Thai - Nichi Institute of
Technology, Bangkok
7
•join : {‘inner’, ‘outer’}, default ‘outer’. How to handle indexes on other axis(es).
Outer for union and inner for intersection.
•ignore_index : boolean, default False. If True, do not use the index values on the
concatenation axis. The resulting axis will be labeled 0, …, n - 1. This is useful if you are
concatenating objects where the concatenation axis does not have meaningful indexing
information. Note the index values on the other axes are still respected in the join.
Syntax of concat()
Faculty of Information Technology, Thai - Nichi Institute of
Technology, Bangkok
8
•keys : sequence, default None. Construct hierarchical index using the passed
keys as the outermost level. If multiple levels passed, should contain tuples.
•levels : list of sequences, default None. Specific levels (unique values) to use
for constructing a MultiIndex. Otherwise they will be inferred from the keys.
•names : list, default None. Names for the levels in the resulting hierarchical index.
Syntax of concat()
Faculty of Information Technology, Thai - Nichi Institute of
Technology, Bangkok
9
•verify_integrity : boolean, default False. Check whether the new concatenated
axis contains duplicates. This can be very expensive relative to the
actual data concatenation.
•copy : boolean, default True. If False, do not copy data unnecessarily.
Example
Faculty of Information Technology, Thai - Nichi Institute of
Technology, Bangkok
10
Example
• Available Data frames: df1, df2 and df3
Faculty of Information Technology, Thai - Nichi Institute of
Technology, Bangkok
11
Creation of arrays
Faculty of Information Technology, Thai - Nichi Institute of
Technology, Bangkok
12
Creation of arrays
Faculty of Information Technology, Thai - Nichi Institute of
Technology, Bangkok
13
Creation of arrays
Faculty of Information Technology, Thai - Nichi Institute of
Technology, Bangkok
14
Creation of Arrays
Faculty of Information Technology, Thai - Nichi Institute of
Technology, Bangkok
15
Frames
Faculty of Information Technology, Thai - Nichi Institute of
Technology, Bangkok
16
Concatenation
Faculty of Information Technology, Thai - Nichi Institute of
Technology, Bangkok
17
Concatenation views
Faculty of Information Technology, Thai - Nichi Institute of
Technology, Bangkok
18
Setting other axes
Faculty of Information Technology, Thai - Nichi Institute of
Technology, Bangkok
19
Setting other axes
Faculty of Information Technology, Thai - Nichi Institute of
Technology, Bangkok
20
Setting other axes
Faculty of Information Technology, Thai - Nichi Institute of
Technology, Bangkok
21
Inner Join
Faculty of Information Technology, Thai - Nichi Institute of
Technology, Bangkok
22
Outer Join
Faculty of Information Technology, Thai - Nichi Institute of
Technology, Bangkok
23
Append()
• Alternative to concat()
• Combines two dataframes in first index only
Faculty of Information Technology, Thai - Nichi Institute of
Technology, Bangkok
24
Append
Faculty of Information Technology, Thai - Nichi Institute of
Technology, Bangkok
25
Sort
Faculty of Information Technology, Thai - Nichi Institute of
Technology, Bangkok
26
Append multiple dataframes
Faculty of Information Technology, Thai - Nichi Institute of
Technology, Bangkok
27
Varying dimension concatenation
Faculty of Information Technology, Thai - Nichi Institute of
Technology, Bangkok
28
Appending rows to a dataframe
Faculty of Information Technology, Thai - Nichi Institute of
Technology, Bangkok
29
How it works with csv, json and xml
• Convert these files to pandas dataframe object
• Play with concat or append
Faculty of Information Technology, Thai - Nichi Institute of
Technology, Bangkok
30
DSA 207 - Merging
• Create two arrays A1 and A2 and convert them into pandas data
frame. Merge the data frames and store in A2. Display A2 before and
after merging
• Merge the given csv files together using pandas and display the first
10 data and last 15 data.
Faculty of Information Technology, Thai - Nichi Institute of
Technology, Bangkok
31

Contenu connexe

Tendances

「みんなと同じ」はなぜ起こる?
「みんなと同じ」はなぜ起こる?「みんなと同じ」はなぜ起こる?
「みんなと同じ」はなぜ起こる?Yosuke YASUDA
 
書籍 「Python FlaskによるWebアプリ開発入門 物体検知アプリ&機械学習APIの作り方」 を通して伝えたいFlaskのプラクティス.pdf
書籍 「Python FlaskによるWebアプリ開発入門 物体検知アプリ&機械学習APIの作り方」 を通して伝えたいFlaskのプラクティス.pdf書籍 「Python FlaskによるWebアプリ開発入門 物体検知アプリ&機械学習APIの作り方」 を通して伝えたいFlaskのプラクティス.pdf
書籍 「Python FlaskによるWebアプリ開発入門 物体検知アプリ&機械学習APIの作り方」 を通して伝えたいFlaskのプラクティス.pdftaisa831
 
SegFormer: Simple and Efficient Design for Semantic Segmentation with Transfo...
SegFormer: Simple and Efficient Design for Semantic Segmentation with Transfo...SegFormer: Simple and Efficient Design for Semantic Segmentation with Transfo...
SegFormer: Simple and Efficient Design for Semantic Segmentation with Transfo...harmonylab
 
ソフトウェア品質技術の歴史を振り返る - ソフトウェア品質測定を中心に -
ソフトウェア品質技術の歴史を振り返る - ソフトウェア品質測定を中心に -ソフトウェア品質技術の歴史を振り返る - ソフトウェア品質測定を中心に -
ソフトウェア品質技術の歴史を振り返る - ソフトウェア品質測定を中心に -Keizo Tatsumi
 
日本アジャイル昔話 『忘れられたXPer』 XP祭り2021
日本アジャイル昔話 『忘れられたXPer』 XP祭り2021日本アジャイル昔話 『忘れられたXPer』 XP祭り2021
日本アジャイル昔話 『忘れられたXPer』 XP祭り2021Takeshi Kakeda
 
ユーザー分析における特徴量の作り方
ユーザー分析における特徴量の作り方ユーザー分析における特徴量の作り方
ユーザー分析における特徴量の作り方Kazuya Obanayama
 
セキュアコーディング方法論再構築の試み
セキュアコーディング方法論再構築の試みセキュアコーディング方法論再構築の試み
セキュアコーディング方法論再構築の試みHiroshi Tokumaru
 
未経験者から世界と渡り合うネットワークエンジニアになるためのキャリア設計術
未経験者から世界と渡り合うネットワークエンジニアになるためのキャリア設計術未経験者から世界と渡り合うネットワークエンジニアになるためのキャリア設計術
未経験者から世界と渡り合うネットワークエンジニアになるためのキャリア設計術Taiji Tsuchiya
 
STAIR Lab Seminar 202105
STAIR Lab Seminar 202105STAIR Lab Seminar 202105
STAIR Lab Seminar 202105Sho Takase
 
[DLHacks 実装]Network Dissection: Quantifying Interpretability of Deep Visual R...
[DLHacks 実装]Network Dissection: Quantifying Interpretability of Deep Visual R...[DLHacks 実装]Network Dissection: Quantifying Interpretability of Deep Visual R...
[DLHacks 実装]Network Dissection: Quantifying Interpretability of Deep Visual R...Deep Learning JP
 
大学院進学が切り拓く情報系学生のキャリア
大学院進学が切り拓く情報系学生のキャリア大学院進学が切り拓く情報系学生のキャリア
大学院進学が切り拓く情報系学生のキャリアTakayuki Itoh
 
実践・最強最速のアルゴリズム勉強会 第五回講義資料(ワークスアプリケーションズ & AtCoder)
実践・最強最速のアルゴリズム勉強会 第五回講義資料(ワークスアプリケーションズ & AtCoder)実践・最強最速のアルゴリズム勉強会 第五回講義資料(ワークスアプリケーションズ & AtCoder)
実践・最強最速のアルゴリズム勉強会 第五回講義資料(ワークスアプリケーションズ & AtCoder)AtCoder Inc.
 
自然言語処理による企業の気候変動対策分析
自然言語処理による企業の気候変動対策分析自然言語処理による企業の気候変動対策分析
自然言語処理による企業の気候変動対策分析Takahiro Kubo
 
ICML 2021 Workshop 深層学習の不確実性について
ICML 2021 Workshop 深層学習の不確実性についてICML 2021 Workshop 深層学習の不確実性について
ICML 2021 Workshop 深層学習の不確実性についてtmtm otm
 
組合せ最適化を体系的に知ってPythonで実行してみよう PyCon 2015
組合せ最適化を体系的に知ってPythonで実行してみよう PyCon 2015組合せ最適化を体系的に知ってPythonで実行してみよう PyCon 2015
組合せ最適化を体系的に知ってPythonで実行してみよう PyCon 2015SaitoTsutomu
 
機械翻訳の今昔物語
機械翻訳の今昔物語機械翻訳の今昔物語
機械翻訳の今昔物語Hiroshi Nakagawa
 
LINEの新卒採用試験 ズバリ問題解説
LINEの新卒採用試験 ズバリ問題解説LINEの新卒採用試験 ズバリ問題解説
LINEの新卒採用試験 ズバリ問題解説LINE Corporation
 
[DL輪読会]Taskonomy: Disentangling Task Transfer Learning
[DL輪読会]Taskonomy: Disentangling Task Transfer Learning[DL輪読会]Taskonomy: Disentangling Task Transfer Learning
[DL輪読会]Taskonomy: Disentangling Task Transfer LearningDeep Learning JP
 
C#とILとネイティブと
C#とILとネイティブとC#とILとネイティブと
C#とILとネイティブと信之 岩永
 

Tendances (20)

「みんなと同じ」はなぜ起こる?
「みんなと同じ」はなぜ起こる?「みんなと同じ」はなぜ起こる?
「みんなと同じ」はなぜ起こる?
 
書籍 「Python FlaskによるWebアプリ開発入門 物体検知アプリ&機械学習APIの作り方」 を通して伝えたいFlaskのプラクティス.pdf
書籍 「Python FlaskによるWebアプリ開発入門 物体検知アプリ&機械学習APIの作り方」 を通して伝えたいFlaskのプラクティス.pdf書籍 「Python FlaskによるWebアプリ開発入門 物体検知アプリ&機械学習APIの作り方」 を通して伝えたいFlaskのプラクティス.pdf
書籍 「Python FlaskによるWebアプリ開発入門 物体検知アプリ&機械学習APIの作り方」 を通して伝えたいFlaskのプラクティス.pdf
 
SegFormer: Simple and Efficient Design for Semantic Segmentation with Transfo...
SegFormer: Simple and Efficient Design for Semantic Segmentation with Transfo...SegFormer: Simple and Efficient Design for Semantic Segmentation with Transfo...
SegFormer: Simple and Efficient Design for Semantic Segmentation with Transfo...
 
ソフトウェア品質技術の歴史を振り返る - ソフトウェア品質測定を中心に -
ソフトウェア品質技術の歴史を振り返る - ソフトウェア品質測定を中心に -ソフトウェア品質技術の歴史を振り返る - ソフトウェア品質測定を中心に -
ソフトウェア品質技術の歴史を振り返る - ソフトウェア品質測定を中心に -
 
日本アジャイル昔話 『忘れられたXPer』 XP祭り2021
日本アジャイル昔話 『忘れられたXPer』 XP祭り2021日本アジャイル昔話 『忘れられたXPer』 XP祭り2021
日本アジャイル昔話 『忘れられたXPer』 XP祭り2021
 
ユーザー分析における特徴量の作り方
ユーザー分析における特徴量の作り方ユーザー分析における特徴量の作り方
ユーザー分析における特徴量の作り方
 
セキュアコーディング方法論再構築の試み
セキュアコーディング方法論再構築の試みセキュアコーディング方法論再構築の試み
セキュアコーディング方法論再構築の試み
 
未経験者から世界と渡り合うネットワークエンジニアになるためのキャリア設計術
未経験者から世界と渡り合うネットワークエンジニアになるためのキャリア設計術未経験者から世界と渡り合うネットワークエンジニアになるためのキャリア設計術
未経験者から世界と渡り合うネットワークエンジニアになるためのキャリア設計術
 
STAIR Lab Seminar 202105
STAIR Lab Seminar 202105STAIR Lab Seminar 202105
STAIR Lab Seminar 202105
 
[DLHacks 実装]Network Dissection: Quantifying Interpretability of Deep Visual R...
[DLHacks 実装]Network Dissection: Quantifying Interpretability of Deep Visual R...[DLHacks 実装]Network Dissection: Quantifying Interpretability of Deep Visual R...
[DLHacks 実装]Network Dissection: Quantifying Interpretability of Deep Visual R...
 
大学院進学が切り拓く情報系学生のキャリア
大学院進学が切り拓く情報系学生のキャリア大学院進学が切り拓く情報系学生のキャリア
大学院進学が切り拓く情報系学生のキャリア
 
WayOfNoTrouble.pptx
WayOfNoTrouble.pptxWayOfNoTrouble.pptx
WayOfNoTrouble.pptx
 
実践・最強最速のアルゴリズム勉強会 第五回講義資料(ワークスアプリケーションズ & AtCoder)
実践・最強最速のアルゴリズム勉強会 第五回講義資料(ワークスアプリケーションズ & AtCoder)実践・最強最速のアルゴリズム勉強会 第五回講義資料(ワークスアプリケーションズ & AtCoder)
実践・最強最速のアルゴリズム勉強会 第五回講義資料(ワークスアプリケーションズ & AtCoder)
 
自然言語処理による企業の気候変動対策分析
自然言語処理による企業の気候変動対策分析自然言語処理による企業の気候変動対策分析
自然言語処理による企業の気候変動対策分析
 
ICML 2021 Workshop 深層学習の不確実性について
ICML 2021 Workshop 深層学習の不確実性についてICML 2021 Workshop 深層学習の不確実性について
ICML 2021 Workshop 深層学習の不確実性について
 
組合せ最適化を体系的に知ってPythonで実行してみよう PyCon 2015
組合せ最適化を体系的に知ってPythonで実行してみよう PyCon 2015組合せ最適化を体系的に知ってPythonで実行してみよう PyCon 2015
組合せ最適化を体系的に知ってPythonで実行してみよう PyCon 2015
 
機械翻訳の今昔物語
機械翻訳の今昔物語機械翻訳の今昔物語
機械翻訳の今昔物語
 
LINEの新卒採用試験 ズバリ問題解説
LINEの新卒採用試験 ズバリ問題解説LINEの新卒採用試験 ズバリ問題解説
LINEの新卒採用試験 ズバリ問題解説
 
[DL輪読会]Taskonomy: Disentangling Task Transfer Learning
[DL輪読会]Taskonomy: Disentangling Task Transfer Learning[DL輪読会]Taskonomy: Disentangling Task Transfer Learning
[DL輪読会]Taskonomy: Disentangling Task Transfer Learning
 
C#とILとネイティブと
C#とILとネイティブとC#とILとネイティブと
C#とILとネイティブと
 

Similaire à Week2: Programming for Data Analysis

Data Structures and Algorithm - Week 3 - Stacks and Queues
Data Structures and Algorithm - Week 3 - Stacks and QueuesData Structures and Algorithm - Week 3 - Stacks and Queues
Data Structures and Algorithm - Week 3 - Stacks and QueuesFerdin Joe John Joseph PhD
 
Data Structures and Algorithm - Week 11 - Algorithm Analysis
Data Structures and Algorithm - Week 11 - Algorithm AnalysisData Structures and Algorithm - Week 11 - Algorithm Analysis
Data Structures and Algorithm - Week 11 - Algorithm AnalysisFerdin Joe John Joseph PhD
 
Evaluating Machine Learning Algorithms for Materials Science using the Matben...
Evaluating Machine Learning Algorithms for Materials Science using the Matben...Evaluating Machine Learning Algorithms for Materials Science using the Matben...
Evaluating Machine Learning Algorithms for Materials Science using the Matben...Anubhav Jain
 

Similaire à Week2: Programming for Data Analysis (20)

Week 1: Programming for Data Analysis
Week 1: Programming for Data AnalysisWeek 1: Programming for Data Analysis
Week 1: Programming for Data Analysis
 
Data Wrangling Week 4
Data Wrangling Week 4Data Wrangling Week 4
Data Wrangling Week 4
 
Week 9: Programming for Data Analysis
Week 9: Programming for Data AnalysisWeek 9: Programming for Data Analysis
Week 9: Programming for Data Analysis
 
Data Structures and Algorithm - Week 3 - Stacks and Queues
Data Structures and Algorithm - Week 3 - Stacks and QueuesData Structures and Algorithm - Week 3 - Stacks and Queues
Data Structures and Algorithm - Week 3 - Stacks and Queues
 
Data wrangling week3
Data wrangling week3Data wrangling week3
Data wrangling week3
 
Data Wrangling Week 7
Data Wrangling Week 7Data Wrangling Week 7
Data Wrangling Week 7
 
Data wrangling week2
Data wrangling week2Data wrangling week2
Data wrangling week2
 
Data wrangling week 5
Data wrangling week 5Data wrangling week 5
Data wrangling week 5
 
Week 8: Programming for Data Analysis
Week 8: Programming for Data AnalysisWeek 8: Programming for Data Analysis
Week 8: Programming for Data Analysis
 
Deep Learning and CNN Architectures
Deep Learning and CNN ArchitecturesDeep Learning and CNN Architectures
Deep Learning and CNN Architectures
 
Data wrangling week 6
Data wrangling week 6Data wrangling week 6
Data wrangling week 6
 
Programming for Data Analysis: Week 3
Programming for Data Analysis: Week 3Programming for Data Analysis: Week 3
Programming for Data Analysis: Week 3
 
Data Structures and Algorithm - Week 11 - Algorithm Analysis
Data Structures and Algorithm - Week 11 - Algorithm AnalysisData Structures and Algorithm - Week 11 - Algorithm Analysis
Data Structures and Algorithm - Week 11 - Algorithm Analysis
 
Intro.ppt
Intro.pptIntro.ppt
Intro.ppt
 
Intro.ppt
Intro.pptIntro.ppt
Intro.ppt
 
Intro_2.ppt
Intro_2.pptIntro_2.ppt
Intro_2.ppt
 
Week 11: Programming for Data Analysis
Week 11: Programming for Data AnalysisWeek 11: Programming for Data Analysis
Week 11: Programming for Data Analysis
 
Week 10: Programming for Data Analysis
Week 10: Programming for Data AnalysisWeek 10: Programming for Data Analysis
Week 10: Programming for Data Analysis
 
COMPUTER LABORATORY-4 LAB MANUAL BE COMPUTER ENGINEERING
COMPUTER LABORATORY-4 LAB MANUAL BE COMPUTER ENGINEERINGCOMPUTER LABORATORY-4 LAB MANUAL BE COMPUTER ENGINEERING
COMPUTER LABORATORY-4 LAB MANUAL BE COMPUTER ENGINEERING
 
Evaluating Machine Learning Algorithms for Materials Science using the Matben...
Evaluating Machine Learning Algorithms for Materials Science using the Matben...Evaluating Machine Learning Algorithms for Materials Science using the Matben...
Evaluating Machine Learning Algorithms for Materials Science using the Matben...
 

Plus de Ferdin Joe John Joseph PhD

Week 11: Cloud Native- DSA 441 Cloud Computing
Week 11: Cloud Native- DSA 441 Cloud ComputingWeek 11: Cloud Native- DSA 441 Cloud Computing
Week 11: Cloud Native- DSA 441 Cloud ComputingFerdin Joe John Joseph PhD
 
Week 10: Cloud Security- DSA 441 Cloud Computing
Week 10: Cloud Security- DSA 441 Cloud ComputingWeek 10: Cloud Security- DSA 441 Cloud Computing
Week 10: Cloud Security- DSA 441 Cloud ComputingFerdin Joe John Joseph PhD
 
Week 9: Relational Database Service Alibaba Cloud- DSA 441 Cloud Computing
Week 9: Relational Database Service Alibaba Cloud- DSA 441 Cloud ComputingWeek 9: Relational Database Service Alibaba Cloud- DSA 441 Cloud Computing
Week 9: Relational Database Service Alibaba Cloud- DSA 441 Cloud ComputingFerdin Joe John Joseph PhD
 
Week 6: Server Load Balancer and Auto Scaling Alibaba Cloud- DSA 441 Cloud Co...
Week 6: Server Load Balancer and Auto Scaling Alibaba Cloud- DSA 441 Cloud Co...Week 6: Server Load Balancer and Auto Scaling Alibaba Cloud- DSA 441 Cloud Co...
Week 6: Server Load Balancer and Auto Scaling Alibaba Cloud- DSA 441 Cloud Co...Ferdin Joe John Joseph PhD
 
Week 5: Elastic Compute Service (ECS) with Alibaba Cloud- DSA 441 Cloud Compu...
Week 5: Elastic Compute Service (ECS) with Alibaba Cloud- DSA 441 Cloud Compu...Week 5: Elastic Compute Service (ECS) with Alibaba Cloud- DSA 441 Cloud Compu...
Week 5: Elastic Compute Service (ECS) with Alibaba Cloud- DSA 441 Cloud Compu...Ferdin Joe John Joseph PhD
 
Week 4: Big Data and Hadoop in Alibaba Cloud - DSA 441 Cloud Computing
Week 4: Big Data and Hadoop in Alibaba Cloud - DSA 441 Cloud ComputingWeek 4: Big Data and Hadoop in Alibaba Cloud - DSA 441 Cloud Computing
Week 4: Big Data and Hadoop in Alibaba Cloud - DSA 441 Cloud ComputingFerdin Joe John Joseph PhD
 
Week 3: Virtual Private Cloud, On Premise, IaaS, PaaS, SaaS - DSA 441 Cloud C...
Week 3: Virtual Private Cloud, On Premise, IaaS, PaaS, SaaS - DSA 441 Cloud C...Week 3: Virtual Private Cloud, On Premise, IaaS, PaaS, SaaS - DSA 441 Cloud C...
Week 3: Virtual Private Cloud, On Premise, IaaS, PaaS, SaaS - DSA 441 Cloud C...Ferdin Joe John Joseph PhD
 
Week 2: Virtualization and VM Ware - DSA 441 Cloud Computing
Week 2: Virtualization and VM Ware - DSA 441 Cloud ComputingWeek 2: Virtualization and VM Ware - DSA 441 Cloud Computing
Week 2: Virtualization and VM Ware - DSA 441 Cloud ComputingFerdin Joe John Joseph PhD
 
Week 1: Introduction to Cloud Computing - DSA 441 Cloud Computing
Week 1: Introduction to Cloud Computing - DSA 441 Cloud ComputingWeek 1: Introduction to Cloud Computing - DSA 441 Cloud Computing
Week 1: Introduction to Cloud Computing - DSA 441 Cloud ComputingFerdin Joe John Joseph PhD
 
Sept 6 2021 BTech Artificial Intelligence and Data Science curriculum
Sept 6 2021 BTech Artificial Intelligence and Data Science curriculumSept 6 2021 BTech Artificial Intelligence and Data Science curriculum
Sept 6 2021 BTech Artificial Intelligence and Data Science curriculumFerdin Joe John Joseph PhD
 
Transforming deep into transformers – a computer vision approach
Transforming deep into transformers – a computer vision approachTransforming deep into transformers – a computer vision approach
Transforming deep into transformers – a computer vision approachFerdin Joe John Joseph PhD
 

Plus de Ferdin Joe John Joseph PhD (20)

Invited Talk DGTiCon 2022
Invited Talk DGTiCon 2022Invited Talk DGTiCon 2022
Invited Talk DGTiCon 2022
 
Week 12: Cloud AI- DSA 441 Cloud Computing
Week 12: Cloud AI- DSA 441 Cloud ComputingWeek 12: Cloud AI- DSA 441 Cloud Computing
Week 12: Cloud AI- DSA 441 Cloud Computing
 
Week 11: Cloud Native- DSA 441 Cloud Computing
Week 11: Cloud Native- DSA 441 Cloud ComputingWeek 11: Cloud Native- DSA 441 Cloud Computing
Week 11: Cloud Native- DSA 441 Cloud Computing
 
Week 10: Cloud Security- DSA 441 Cloud Computing
Week 10: Cloud Security- DSA 441 Cloud ComputingWeek 10: Cloud Security- DSA 441 Cloud Computing
Week 10: Cloud Security- DSA 441 Cloud Computing
 
Week 9: Relational Database Service Alibaba Cloud- DSA 441 Cloud Computing
Week 9: Relational Database Service Alibaba Cloud- DSA 441 Cloud ComputingWeek 9: Relational Database Service Alibaba Cloud- DSA 441 Cloud Computing
Week 9: Relational Database Service Alibaba Cloud- DSA 441 Cloud Computing
 
Week 6: Server Load Balancer and Auto Scaling Alibaba Cloud- DSA 441 Cloud Co...
Week 6: Server Load Balancer and Auto Scaling Alibaba Cloud- DSA 441 Cloud Co...Week 6: Server Load Balancer and Auto Scaling Alibaba Cloud- DSA 441 Cloud Co...
Week 6: Server Load Balancer and Auto Scaling Alibaba Cloud- DSA 441 Cloud Co...
 
Week 5: Elastic Compute Service (ECS) with Alibaba Cloud- DSA 441 Cloud Compu...
Week 5: Elastic Compute Service (ECS) with Alibaba Cloud- DSA 441 Cloud Compu...Week 5: Elastic Compute Service (ECS) with Alibaba Cloud- DSA 441 Cloud Compu...
Week 5: Elastic Compute Service (ECS) with Alibaba Cloud- DSA 441 Cloud Compu...
 
Week 4: Big Data and Hadoop in Alibaba Cloud - DSA 441 Cloud Computing
Week 4: Big Data and Hadoop in Alibaba Cloud - DSA 441 Cloud ComputingWeek 4: Big Data and Hadoop in Alibaba Cloud - DSA 441 Cloud Computing
Week 4: Big Data and Hadoop in Alibaba Cloud - DSA 441 Cloud Computing
 
Week 3: Virtual Private Cloud, On Premise, IaaS, PaaS, SaaS - DSA 441 Cloud C...
Week 3: Virtual Private Cloud, On Premise, IaaS, PaaS, SaaS - DSA 441 Cloud C...Week 3: Virtual Private Cloud, On Premise, IaaS, PaaS, SaaS - DSA 441 Cloud C...
Week 3: Virtual Private Cloud, On Premise, IaaS, PaaS, SaaS - DSA 441 Cloud C...
 
Week 2: Virtualization and VM Ware - DSA 441 Cloud Computing
Week 2: Virtualization and VM Ware - DSA 441 Cloud ComputingWeek 2: Virtualization and VM Ware - DSA 441 Cloud Computing
Week 2: Virtualization and VM Ware - DSA 441 Cloud Computing
 
Week 1: Introduction to Cloud Computing - DSA 441 Cloud Computing
Week 1: Introduction to Cloud Computing - DSA 441 Cloud ComputingWeek 1: Introduction to Cloud Computing - DSA 441 Cloud Computing
Week 1: Introduction to Cloud Computing - DSA 441 Cloud Computing
 
Sept 6 2021 BTech Artificial Intelligence and Data Science curriculum
Sept 6 2021 BTech Artificial Intelligence and Data Science curriculumSept 6 2021 BTech Artificial Intelligence and Data Science curriculum
Sept 6 2021 BTech Artificial Intelligence and Data Science curriculum
 
Hadoop in Alibaba Cloud
Hadoop in Alibaba CloudHadoop in Alibaba Cloud
Hadoop in Alibaba Cloud
 
Cloud Computing Essentials in Alibaba Cloud
Cloud Computing Essentials in Alibaba CloudCloud Computing Essentials in Alibaba Cloud
Cloud Computing Essentials in Alibaba Cloud
 
Transforming deep into transformers – a computer vision approach
Transforming deep into transformers – a computer vision approachTransforming deep into transformers – a computer vision approach
Transforming deep into transformers – a computer vision approach
 
Programming for Data Analysis: Week 4
Programming for Data Analysis: Week 4Programming for Data Analysis: Week 4
Programming for Data Analysis: Week 4
 
Deep learning - Introduction
Deep learning - IntroductionDeep learning - Introduction
Deep learning - Introduction
 
Data wrangling week 10
Data wrangling week 10Data wrangling week 10
Data wrangling week 10
 
Data wrangling week 11
Data wrangling week 11Data wrangling week 11
Data wrangling week 11
 
Data wrangling week 9
Data wrangling week 9Data wrangling week 9
Data wrangling week 9
 

Dernier

Decoding Movie Sentiments: Analyzing Reviews with Data Analysis model
Decoding Movie Sentiments: Analyzing Reviews with Data Analysis modelDecoding Movie Sentiments: Analyzing Reviews with Data Analysis model
Decoding Movie Sentiments: Analyzing Reviews with Data Analysis modelBoston Institute of Analytics
 
Presentation of project of business person who are success
Presentation of project of business person who are successPresentation of project of business person who are success
Presentation of project of business person who are successPratikSingh115843
 
Statistics For Management by Richard I. Levin 8ed.pdf
Statistics For Management by Richard I. Levin 8ed.pdfStatistics For Management by Richard I. Levin 8ed.pdf
Statistics For Management by Richard I. Levin 8ed.pdfnikeshsingh56
 
Role of Consumer Insights in business transformation
Role of Consumer Insights in business transformationRole of Consumer Insights in business transformation
Role of Consumer Insights in business transformationAnnie Melnic
 
English-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdf
English-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdfEnglish-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdf
English-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdfblazblazml
 
Digital Indonesia Report 2024 by We Are Social .pdf
Digital Indonesia Report 2024 by We Are Social .pdfDigital Indonesia Report 2024 by We Are Social .pdf
Digital Indonesia Report 2024 by We Are Social .pdfNicoChristianSunaryo
 
IBEF report on the Insurance market in India
IBEF report on the Insurance market in IndiaIBEF report on the Insurance market in India
IBEF report on the Insurance market in IndiaManalVerma4
 
DATA ANALYSIS using various data sets like shoping data set etc
DATA ANALYSIS using various data sets like shoping data set etcDATA ANALYSIS using various data sets like shoping data set etc
DATA ANALYSIS using various data sets like shoping data set etclalithasri22
 
Digital Marketing Plan, how digital marketing works
Digital Marketing Plan, how digital marketing worksDigital Marketing Plan, how digital marketing works
Digital Marketing Plan, how digital marketing worksdeepakthakur548787
 
Non Text Magic Studio Magic Design for Presentations L&P.pdf
Non Text Magic Studio Magic Design for Presentations L&P.pdfNon Text Magic Studio Magic Design for Presentations L&P.pdf
Non Text Magic Studio Magic Design for Presentations L&P.pdfPratikPatil591646
 
Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...
Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...
Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...Boston Institute of Analytics
 
Bank Loan Approval Analysis: A Comprehensive Data Analysis Project
Bank Loan Approval Analysis: A Comprehensive Data Analysis ProjectBank Loan Approval Analysis: A Comprehensive Data Analysis Project
Bank Loan Approval Analysis: A Comprehensive Data Analysis ProjectBoston Institute of Analytics
 
6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...
6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...
6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...Dr Arash Najmaei ( Phd., MBA, BSc)
 
why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...
why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...
why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...Jack Cole
 

Dernier (17)

Decoding Movie Sentiments: Analyzing Reviews with Data Analysis model
Decoding Movie Sentiments: Analyzing Reviews with Data Analysis modelDecoding Movie Sentiments: Analyzing Reviews with Data Analysis model
Decoding Movie Sentiments: Analyzing Reviews with Data Analysis model
 
Presentation of project of business person who are success
Presentation of project of business person who are successPresentation of project of business person who are success
Presentation of project of business person who are success
 
Statistics For Management by Richard I. Levin 8ed.pdf
Statistics For Management by Richard I. Levin 8ed.pdfStatistics For Management by Richard I. Levin 8ed.pdf
Statistics For Management by Richard I. Levin 8ed.pdf
 
Role of Consumer Insights in business transformation
Role of Consumer Insights in business transformationRole of Consumer Insights in business transformation
Role of Consumer Insights in business transformation
 
English-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdf
English-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdfEnglish-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdf
English-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdf
 
Digital Indonesia Report 2024 by We Are Social .pdf
Digital Indonesia Report 2024 by We Are Social .pdfDigital Indonesia Report 2024 by We Are Social .pdf
Digital Indonesia Report 2024 by We Are Social .pdf
 
IBEF report on the Insurance market in India
IBEF report on the Insurance market in IndiaIBEF report on the Insurance market in India
IBEF report on the Insurance market in India
 
DATA ANALYSIS using various data sets like shoping data set etc
DATA ANALYSIS using various data sets like shoping data set etcDATA ANALYSIS using various data sets like shoping data set etc
DATA ANALYSIS using various data sets like shoping data set etc
 
2023 Survey Shows Dip in High School E-Cigarette Use
2023 Survey Shows Dip in High School E-Cigarette Use2023 Survey Shows Dip in High School E-Cigarette Use
2023 Survey Shows Dip in High School E-Cigarette Use
 
Digital Marketing Plan, how digital marketing works
Digital Marketing Plan, how digital marketing worksDigital Marketing Plan, how digital marketing works
Digital Marketing Plan, how digital marketing works
 
Data Analysis Project: Stroke Prediction
Data Analysis Project: Stroke PredictionData Analysis Project: Stroke Prediction
Data Analysis Project: Stroke Prediction
 
Non Text Magic Studio Magic Design for Presentations L&P.pdf
Non Text Magic Studio Magic Design for Presentations L&P.pdfNon Text Magic Studio Magic Design for Presentations L&P.pdf
Non Text Magic Studio Magic Design for Presentations L&P.pdf
 
Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...
Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...
Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...
 
Bank Loan Approval Analysis: A Comprehensive Data Analysis Project
Bank Loan Approval Analysis: A Comprehensive Data Analysis ProjectBank Loan Approval Analysis: A Comprehensive Data Analysis Project
Bank Loan Approval Analysis: A Comprehensive Data Analysis Project
 
6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...
6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...
6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...
 
Insurance Churn Prediction Data Analysis Project
Insurance Churn Prediction Data Analysis ProjectInsurance Churn Prediction Data Analysis Project
Insurance Churn Prediction Data Analysis Project
 
why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...
why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...
why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...
 

Week2: Programming for Data Analysis

  • 1. Programming for Data Analysis Week 2 Dr. Ferdin Joe John Joseph Faculty of Information Technology Thai – Nichi Institute of Technology, Bangkok
  • 2. Today’s lesson Faculty of Information Technology, Thai - Nichi Institute of Technology, Bangkok 2 • Merging • Concatenating • Reshaping • Laboratory
  • 3. Merging • Used in pandas to combine data from two sources • Sources can be from same format or different • csv and csv, csv and json, json and xml and a concoction of all these • Similar to numpy array manipulation but effective with pandas Faculty of Information Technology, Thai - Nichi Institute of Technology, Bangkok 3
  • 4. Function Used concat() Faculty of Information Technology, Thai - Nichi Institute of Technology, Bangkok 4
  • 5. Syntax of concat() Faculty of Information Technology, Thai - Nichi Institute of Technology, Bangkok 5
  • 6. Syntax of concat() Faculty of Information Technology, Thai - Nichi Institute of Technology, Bangkok 6 •objs : a sequence or mapping of Series or DataFrame objects. If a dict is passed, the sorted keys will be used as the keys argument, unless it is passed, in which case the values will be selected (see below). Any None objects will be dropped silently unless they are all None in which case a ValueError will be raised. •axis : {0, 1, …}, default 0. The axis to concatenate along.
  • 7. Syntax of concat() Faculty of Information Technology, Thai - Nichi Institute of Technology, Bangkok 7 •join : {‘inner’, ‘outer’}, default ‘outer’. How to handle indexes on other axis(es). Outer for union and inner for intersection. •ignore_index : boolean, default False. If True, do not use the index values on the concatenation axis. The resulting axis will be labeled 0, …, n - 1. This is useful if you are concatenating objects where the concatenation axis does not have meaningful indexing information. Note the index values on the other axes are still respected in the join.
  • 8. Syntax of concat() Faculty of Information Technology, Thai - Nichi Institute of Technology, Bangkok 8 •keys : sequence, default None. Construct hierarchical index using the passed keys as the outermost level. If multiple levels passed, should contain tuples. •levels : list of sequences, default None. Specific levels (unique values) to use for constructing a MultiIndex. Otherwise they will be inferred from the keys. •names : list, default None. Names for the levels in the resulting hierarchical index.
  • 9. Syntax of concat() Faculty of Information Technology, Thai - Nichi Institute of Technology, Bangkok 9 •verify_integrity : boolean, default False. Check whether the new concatenated axis contains duplicates. This can be very expensive relative to the actual data concatenation. •copy : boolean, default True. If False, do not copy data unnecessarily.
  • 10. Example Faculty of Information Technology, Thai - Nichi Institute of Technology, Bangkok 10
  • 11. Example • Available Data frames: df1, df2 and df3 Faculty of Information Technology, Thai - Nichi Institute of Technology, Bangkok 11
  • 12. Creation of arrays Faculty of Information Technology, Thai - Nichi Institute of Technology, Bangkok 12
  • 13. Creation of arrays Faculty of Information Technology, Thai - Nichi Institute of Technology, Bangkok 13
  • 14. Creation of arrays Faculty of Information Technology, Thai - Nichi Institute of Technology, Bangkok 14
  • 15. Creation of Arrays Faculty of Information Technology, Thai - Nichi Institute of Technology, Bangkok 15
  • 16. Frames Faculty of Information Technology, Thai - Nichi Institute of Technology, Bangkok 16
  • 17. Concatenation Faculty of Information Technology, Thai - Nichi Institute of Technology, Bangkok 17
  • 18. Concatenation views Faculty of Information Technology, Thai - Nichi Institute of Technology, Bangkok 18
  • 19. Setting other axes Faculty of Information Technology, Thai - Nichi Institute of Technology, Bangkok 19
  • 20. Setting other axes Faculty of Information Technology, Thai - Nichi Institute of Technology, Bangkok 20
  • 21. Setting other axes Faculty of Information Technology, Thai - Nichi Institute of Technology, Bangkok 21
  • 22. Inner Join Faculty of Information Technology, Thai - Nichi Institute of Technology, Bangkok 22
  • 23. Outer Join Faculty of Information Technology, Thai - Nichi Institute of Technology, Bangkok 23
  • 24. Append() • Alternative to concat() • Combines two dataframes in first index only Faculty of Information Technology, Thai - Nichi Institute of Technology, Bangkok 24
  • 25. Append Faculty of Information Technology, Thai - Nichi Institute of Technology, Bangkok 25
  • 26. Sort Faculty of Information Technology, Thai - Nichi Institute of Technology, Bangkok 26
  • 27. Append multiple dataframes Faculty of Information Technology, Thai - Nichi Institute of Technology, Bangkok 27
  • 28. Varying dimension concatenation Faculty of Information Technology, Thai - Nichi Institute of Technology, Bangkok 28
  • 29. Appending rows to a dataframe Faculty of Information Technology, Thai - Nichi Institute of Technology, Bangkok 29
  • 30. How it works with csv, json and xml • Convert these files to pandas dataframe object • Play with concat or append Faculty of Information Technology, Thai - Nichi Institute of Technology, Bangkok 30
  • 31. DSA 207 - Merging • Create two arrays A1 and A2 and convert them into pandas data frame. Merge the data frames and store in A2. Display A2 before and after merging • Merge the given csv files together using pandas and display the first 10 data and last 15 data. Faculty of Information Technology, Thai - Nichi Institute of Technology, Bangkok 31