SlideShare a Scribd company logo
1 of 8
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Python Development Example
Read data from Oracle Database into Pandas DataFrame
Johan Louwers – Chief Customer Architect @ Oracle
Version : Feb 2019
@johanlouwers
Johanlouwers.blogspot.com
Oracle Confidential – Internal/Restricted/Highly Restricted
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |
Safe Harbor Statement
The following is intended to outline our general product direction. It is intended for
information purposes only, and may not be incorporated into any contract. It is not a
commitment to deliver any material, code, or functionality, and should not be relied upon
in making purchasing decisions. The development, release, and timing of any features or
functionality described for Oracle’s products remains at the sole discretion of Oracle.
2
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |
Python Development
with pandas and CX_Oracle
Slide-deck Intention :
• This presentation is intended to provide
a quick introduction example on how to
load data from an Oracle Database into
pandas.
• This example is a part of a wider
workshop deck and shared as a stand-
alone example for ease of sharing.
• The code should only be used as an
educational example and is not
intended to be included in any real-
world application code.
3
Contact details :
Johan Louwers - Chief Customer Architect
@johanlouwers
Johan.louwers@oracle.com
github.com/louwersj
Johanlouwers.blogspot.com
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | 4
Python Development
Pandas – read data from database into DataFrame
A B C D
0 A0 B0 C0 D0
1 A1 B1 C1 D1
2 A2 B2 C2 D2
pd.read_sql
What do we want to achieve?
1) Read data from an Oracle database into a DataFrame based upon a SQL query.
2) We use cx_Oracle in combination with Oracle Database 18c
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | 5
import pandas as pd
import cx_Oracle
orclUserName = 'pandas_test'
orclPassword = 'pandas_test'
orclHost = '192.168.33.10'
orclPort = '1521'
orclServiceName = 'pdb1'
dsn = cx_Oracle.makedsn(host=orclHost,
port=orclPort,
sid=None,
service_name=orclServiceName
)
connection = cx_Oracle.connect(user=orclUserName,
password=orclPassword,
dsn=dsn,
encoding="UTF-8",
nencoding="UTF-8"
)
query = """SELECT * FROM emp"""
df_ora = pd.read_sql(query, con=connection)
print (df_ora.head())
Import
cx_Oracle
Provide needed
details
Define the Data
Source Name
Define the
connection
Define the
query
Execute the
read_sql()
Python Development
Pandas – read data from database into DataFrame
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | 6
Show me the output
1) You can verify the output of df_ora.head() with the content of your database EMP table
Python Development
Pandas – read data from database into DataFrame
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 7
import data from Oracle Database into Python Pandas Dataframe

More Related Content

What's hot

Application Mobile "Livre des histoires " avec Corona sdk
Application Mobile "Livre des histoires " avec Corona sdkApplication Mobile "Livre des histoires " avec Corona sdk
Application Mobile "Livre des histoires " avec Corona sdkNazih Heni
 
Rapport sur la mise en plateforme de suivi de l'exploitation des AEPS
Rapport sur la mise en plateforme de suivi de l'exploitation des AEPSRapport sur la mise en plateforme de suivi de l'exploitation des AEPS
Rapport sur la mise en plateforme de suivi de l'exploitation des AEPSYiénouyaba LANKOANDE
 
Cahier des Charges Infrastructure Informatique
Cahier des Charges Infrastructure InformatiqueCahier des Charges Infrastructure Informatique
Cahier des Charges Infrastructure InformatiqueDATANYWARE.com
 
Conception et developpement d'une application mobile Android e-location
Conception et developpement d'une application mobile Android e-locationConception et developpement d'une application mobile Android e-location
Conception et developpement d'une application mobile Android e-locationALALSYSE
 
Augment your reality with ARCore !
Augment your reality with ARCore !Augment your reality with ARCore !
Augment your reality with ARCore !Wajdi Ben Rabah
 
mémoire la légitimité des ONGs vue à travers la question de l'eau
mémoire la légitimité des ONGs vue à travers la question de l'eaumémoire la légitimité des ONGs vue à travers la question de l'eau
mémoire la légitimité des ONGs vue à travers la question de l'eauRobin Abric
 
Instagram Clone | Instagram Clone App | Instagram Clone Script
Instagram Clone | Instagram Clone App | Instagram Clone ScriptInstagram Clone | Instagram Clone App | Instagram Clone Script
Instagram Clone | Instagram Clone App | Instagram Clone ScriptSwethaMohan21
 
Rapport PFE: Gestion de Parc Informatique
Rapport PFE: Gestion de Parc InformatiqueRapport PFE: Gestion de Parc Informatique
Rapport PFE: Gestion de Parc InformatiqueEric Maxime
 
Gestion des Chercheurs d’Emploi
Gestion des Chercheurs d’EmploiGestion des Chercheurs d’Emploi
Gestion des Chercheurs d’EmploiAzzeddine Elouadi
 
PFE :: Application de gestion des dus d'enseignement
PFE :: Application de gestion des dus d'enseignementPFE :: Application de gestion des dus d'enseignement
PFE :: Application de gestion des dus d'enseignementNassim Bahri
 
Installation de snort avec pulled pork
Installation de snort avec pulled porkInstallation de snort avec pulled pork
Installation de snort avec pulled porkSamiMessaoudi4
 
Rapport Projet De Fin D'étude de Conception et développement d’une applicatio...
Rapport Projet De Fin D'étude de Conception et développement d’une applicatio...Rapport Projet De Fin D'étude de Conception et développement d’une applicatio...
Rapport Projet De Fin D'étude de Conception et développement d’une applicatio...mouafekmazia
 
Conception et réalisation d’un Système d’information des étudiants du départe...
Conception et réalisation d’un Système d’information des étudiants du départe...Conception et réalisation d’un Système d’information des étudiants du départe...
Conception et réalisation d’un Système d’information des étudiants du départe...Ilyas CHAOUA
 
Pair Programming Presentation
Pair Programming PresentationPair Programming Presentation
Pair Programming PresentationThoughtWorks
 
Pfe etude-d attaque-finale-1
Pfe etude-d attaque-finale-1Pfe etude-d attaque-finale-1
Pfe etude-d attaque-finale-1Rahma Romdhane
 

What's hot (20)

Application Mobile "Livre des histoires " avec Corona sdk
Application Mobile "Livre des histoires " avec Corona sdkApplication Mobile "Livre des histoires " avec Corona sdk
Application Mobile "Livre des histoires " avec Corona sdk
 
Rapport sur la mise en plateforme de suivi de l'exploitation des AEPS
Rapport sur la mise en plateforme de suivi de l'exploitation des AEPSRapport sur la mise en plateforme de suivi de l'exploitation des AEPS
Rapport sur la mise en plateforme de suivi de l'exploitation des AEPS
 
Cahier des Charges Infrastructure Informatique
Cahier des Charges Infrastructure InformatiqueCahier des Charges Infrastructure Informatique
Cahier des Charges Infrastructure Informatique
 
Conception et developpement d'une application mobile Android e-location
Conception et developpement d'une application mobile Android e-locationConception et developpement d'une application mobile Android e-location
Conception et developpement d'une application mobile Android e-location
 
Augment your reality with ARCore !
Augment your reality with ARCore !Augment your reality with ARCore !
Augment your reality with ARCore !
 
mémoire la légitimité des ONGs vue à travers la question de l'eau
mémoire la légitimité des ONGs vue à travers la question de l'eaumémoire la légitimité des ONGs vue à travers la question de l'eau
mémoire la légitimité des ONGs vue à travers la question de l'eau
 
Instagram Clone | Instagram Clone App | Instagram Clone Script
Instagram Clone | Instagram Clone App | Instagram Clone ScriptInstagram Clone | Instagram Clone App | Instagram Clone Script
Instagram Clone | Instagram Clone App | Instagram Clone Script
 
Corba
CorbaCorba
Corba
 
Rapport PFE: Gestion de Parc Informatique
Rapport PFE: Gestion de Parc InformatiqueRapport PFE: Gestion de Parc Informatique
Rapport PFE: Gestion de Parc Informatique
 
Gestion des Chercheurs d’Emploi
Gestion des Chercheurs d’EmploiGestion des Chercheurs d’Emploi
Gestion des Chercheurs d’Emploi
 
PFE :: Application de gestion des dus d'enseignement
PFE :: Application de gestion des dus d'enseignementPFE :: Application de gestion des dus d'enseignement
PFE :: Application de gestion des dus d'enseignement
 
Installation de snort avec pulled pork
Installation de snort avec pulled porkInstallation de snort avec pulled pork
Installation de snort avec pulled pork
 
Zigbeepresentation
ZigbeepresentationZigbeepresentation
Zigbeepresentation
 
Rapport Projet De Fin D'étude de Conception et développement d’une applicatio...
Rapport Projet De Fin D'étude de Conception et développement d’une applicatio...Rapport Projet De Fin D'étude de Conception et développement d’une applicatio...
Rapport Projet De Fin D'étude de Conception et développement d’une applicatio...
 
Rapid prototyping
Rapid prototypingRapid prototyping
Rapid prototyping
 
Cahier des charges
Cahier des charges Cahier des charges
Cahier des charges
 
Conception et réalisation d’un Système d’information des étudiants du départe...
Conception et réalisation d’un Système d’information des étudiants du départe...Conception et réalisation d’un Système d’information des étudiants du départe...
Conception et réalisation d’un Système d’information des étudiants du départe...
 
Pair Programming Presentation
Pair Programming PresentationPair Programming Presentation
Pair Programming Presentation
 
Pfe etude-d attaque-finale-1
Pfe etude-d attaque-finale-1Pfe etude-d attaque-finale-1
Pfe etude-d attaque-finale-1
 
pfe book 2023 2024.pdf
pfe book 2023 2024.pdfpfe book 2023 2024.pdf
pfe book 2023 2024.pdf
 

Similar to import data from Oracle Database into Python Pandas Dataframe

Oracle python pandas merge DataFrames
Oracle python pandas merge DataFramesOracle python pandas merge DataFrames
Oracle python pandas merge DataFramesJohan Louwers
 
Oracle database 12c_and_DevOps
Oracle database 12c_and_DevOpsOracle database 12c_and_DevOps
Oracle database 12c_and_DevOpsMaria Colgan
 
Modern App Development with Oracle Cloud
Modern App Development with Oracle CloudModern App Development with Oracle Cloud
Modern App Development with Oracle CloudJuan Carlos Ruiz Rico
 
Tame Big Data with Oracle Data Integration
Tame Big Data with Oracle Data IntegrationTame Big Data with Oracle Data Integration
Tame Big Data with Oracle Data IntegrationMichael Rainey
 
Turning Relational Database Tables into Hadoop Datasources by Kuassi Mensah
Turning Relational Database Tables into Hadoop Datasources by Kuassi MensahTurning Relational Database Tables into Hadoop Datasources by Kuassi Mensah
Turning Relational Database Tables into Hadoop Datasources by Kuassi MensahData Con LA
 
Polyglot! A Lightweight Cloud Platform for Java SE, Node, and More
Polyglot! A Lightweight Cloud Platform for Java SE, Node, and MorePolyglot! A Lightweight Cloud Platform for Java SE, Node, and More
Polyglot! A Lightweight Cloud Platform for Java SE, Node, and MoreShaun Smith
 
MV2ADB - Move to Oracle Autonomous Database in One-click
MV2ADB - Move to Oracle Autonomous Database in One-clickMV2ADB - Move to Oracle Autonomous Database in One-click
MV2ADB - Move to Oracle Autonomous Database in One-clickRuggero Citton
 
Big Data Management System: Smart SQL Processing Across Hadoop and your Data ...
Big Data Management System: Smart SQL Processing Across Hadoop and your Data ...Big Data Management System: Smart SQL Processing Across Hadoop and your Data ...
Big Data Management System: Smart SQL Processing Across Hadoop and your Data ...DataWorks Summit
 
DBCS Office Hours - Modernization through Migration
DBCS Office Hours - Modernization through MigrationDBCS Office Hours - Modernization through Migration
DBCS Office Hours - Modernization through MigrationTammy Bednar
 
(ZDM) Zero Downtime DB Migration to Oracle Cloud
(ZDM) Zero Downtime DB Migration to Oracle Cloud(ZDM) Zero Downtime DB Migration to Oracle Cloud
(ZDM) Zero Downtime DB Migration to Oracle CloudRuggero Citton
 
Unlocking Big Data Silos in the Enterprise or the Cloud (Con7877)
Unlocking Big Data Silos in the Enterprise or the Cloud (Con7877)Unlocking Big Data Silos in the Enterprise or the Cloud (Con7877)
Unlocking Big Data Silos in the Enterprise or the Cloud (Con7877)Jeffrey T. Pollock
 
Ovca partner techtraining
Ovca partner techtrainingOvca partner techtraining
Ovca partner techtraininglinh tran
 
Usability - Ignored by Developers and Undervalued by Managers (article)
Usability - Ignored by Developers and Undervalued by Managers (article)Usability - Ignored by Developers and Undervalued by Managers (article)
Usability - Ignored by Developers and Undervalued by Managers (article)Revelation Technologies
 
Using XA for Batch – Bad idea? (article)
Using XA for Batch – Bad idea? (article)Using XA for Batch – Bad idea? (article)
Using XA for Batch – Bad idea? (article)Revelation Technologies
 
Oracle Autonomous Database - introducción técnica y hands on lab
Oracle Autonomous Database  - introducción técnica y hands on labOracle Autonomous Database  - introducción técnica y hands on lab
Oracle Autonomous Database - introducción técnica y hands on lab"Diego \"Perico\"" Sanchez
 
Oracle Data Integration CON9737 at OpenWorld
Oracle Data Integration CON9737 at OpenWorldOracle Data Integration CON9737 at OpenWorld
Oracle Data Integration CON9737 at OpenWorldJeffrey T. Pollock
 
Oracle Database House Party_Oracle Machine Learning to Pick a Good Inexpensiv...
Oracle Database House Party_Oracle Machine Learning to Pick a Good Inexpensiv...Oracle Database House Party_Oracle Machine Learning to Pick a Good Inexpensiv...
Oracle Database House Party_Oracle Machine Learning to Pick a Good Inexpensiv...Charlie Berger
 

Similar to import data from Oracle Database into Python Pandas Dataframe (20)

Oracle python pandas merge DataFrames
Oracle python pandas merge DataFramesOracle python pandas merge DataFrames
Oracle python pandas merge DataFrames
 
Oracle database 12c_and_DevOps
Oracle database 12c_and_DevOpsOracle database 12c_and_DevOps
Oracle database 12c_and_DevOps
 
Modern App Development with Oracle Cloud
Modern App Development with Oracle CloudModern App Development with Oracle Cloud
Modern App Development with Oracle Cloud
 
Tame Big Data with Oracle Data Integration
Tame Big Data with Oracle Data IntegrationTame Big Data with Oracle Data Integration
Tame Big Data with Oracle Data Integration
 
Turning Relational Database Tables into Hadoop Datasources by Kuassi Mensah
Turning Relational Database Tables into Hadoop Datasources by Kuassi MensahTurning Relational Database Tables into Hadoop Datasources by Kuassi Mensah
Turning Relational Database Tables into Hadoop Datasources by Kuassi Mensah
 
Polyglot! A Lightweight Cloud Platform for Java SE, Node, and More
Polyglot! A Lightweight Cloud Platform for Java SE, Node, and MorePolyglot! A Lightweight Cloud Platform for Java SE, Node, and More
Polyglot! A Lightweight Cloud Platform for Java SE, Node, and More
 
MV2ADB - Move to Oracle Autonomous Database in One-click
MV2ADB - Move to Oracle Autonomous Database in One-clickMV2ADB - Move to Oracle Autonomous Database in One-click
MV2ADB - Move to Oracle Autonomous Database in One-click
 
OOW-TBE-12c-CON7307-Sharable
OOW-TBE-12c-CON7307-SharableOOW-TBE-12c-CON7307-Sharable
OOW-TBE-12c-CON7307-Sharable
 
Exadata Cloud Service Overview(v2)
Exadata Cloud Service Overview(v2) Exadata Cloud Service Overview(v2)
Exadata Cloud Service Overview(v2)
 
Extending Hortonworks with Oracle's Big Data Platform
Extending Hortonworks with Oracle's Big Data PlatformExtending Hortonworks with Oracle's Big Data Platform
Extending Hortonworks with Oracle's Big Data Platform
 
Big Data Management System: Smart SQL Processing Across Hadoop and your Data ...
Big Data Management System: Smart SQL Processing Across Hadoop and your Data ...Big Data Management System: Smart SQL Processing Across Hadoop and your Data ...
Big Data Management System: Smart SQL Processing Across Hadoop and your Data ...
 
DBCS Office Hours - Modernization through Migration
DBCS Office Hours - Modernization through MigrationDBCS Office Hours - Modernization through Migration
DBCS Office Hours - Modernization through Migration
 
(ZDM) Zero Downtime DB Migration to Oracle Cloud
(ZDM) Zero Downtime DB Migration to Oracle Cloud(ZDM) Zero Downtime DB Migration to Oracle Cloud
(ZDM) Zero Downtime DB Migration to Oracle Cloud
 
Unlocking Big Data Silos in the Enterprise or the Cloud (Con7877)
Unlocking Big Data Silos in the Enterprise or the Cloud (Con7877)Unlocking Big Data Silos in the Enterprise or the Cloud (Con7877)
Unlocking Big Data Silos in the Enterprise or the Cloud (Con7877)
 
Ovca partner techtraining
Ovca partner techtrainingOvca partner techtraining
Ovca partner techtraining
 
Usability - Ignored by Developers and Undervalued by Managers (article)
Usability - Ignored by Developers and Undervalued by Managers (article)Usability - Ignored by Developers and Undervalued by Managers (article)
Usability - Ignored by Developers and Undervalued by Managers (article)
 
Using XA for Batch – Bad idea? (article)
Using XA for Batch – Bad idea? (article)Using XA for Batch – Bad idea? (article)
Using XA for Batch – Bad idea? (article)
 
Oracle Autonomous Database - introducción técnica y hands on lab
Oracle Autonomous Database  - introducción técnica y hands on labOracle Autonomous Database  - introducción técnica y hands on lab
Oracle Autonomous Database - introducción técnica y hands on lab
 
Oracle Data Integration CON9737 at OpenWorld
Oracle Data Integration CON9737 at OpenWorldOracle Data Integration CON9737 at OpenWorld
Oracle Data Integration CON9737 at OpenWorld
 
Oracle Database House Party_Oracle Machine Learning to Pick a Good Inexpensiv...
Oracle Database House Party_Oracle Machine Learning to Pick a Good Inexpensiv...Oracle Database House Party_Oracle Machine Learning to Pick a Good Inexpensiv...
Oracle Database House Party_Oracle Machine Learning to Pick a Good Inexpensiv...
 

More from Johan Louwers

Multi Domain REST API routing for Data Mesh based Data Products
Multi Domain REST API routing for Data Mesh based Data ProductsMulti Domain REST API routing for Data Mesh based Data Products
Multi Domain REST API routing for Data Mesh based Data ProductsJohan Louwers
 
TClab Dynamic Solar Panel Positioning Systems
TClab Dynamic Solar Panel Positioning SystemsTClab Dynamic Solar Panel Positioning Systems
TClab Dynamic Solar Panel Positioning SystemsJohan Louwers
 
Oracle Cloud With Azure DevOps Pipelines
Oracle Cloud With Azure DevOps PipelinesOracle Cloud With Azure DevOps Pipelines
Oracle Cloud With Azure DevOps PipelinesJohan Louwers
 
Oracle Cloud native functions - create application from cli
Oracle Cloud native functions - create application from cliOracle Cloud native functions - create application from cli
Oracle Cloud native functions - create application from cliJohan Louwers
 
Oracle Labs - research mission & project potfolio
Oracle Labs - research mission & project potfolioOracle Labs - research mission & project potfolio
Oracle Labs - research mission & project potfolioJohan Louwers
 
Install Redis on Oracle Linux
Install Redis on Oracle LinuxInstall Redis on Oracle Linux
Install Redis on Oracle LinuxJohan Louwers
 
Fn project quick installation guide
Fn project quick installation guideFn project quick installation guide
Fn project quick installation guideJohan Louwers
 
Voice assistants for the insurance industry
Voice assistants for the insurance industry Voice assistants for the insurance industry
Voice assistants for the insurance industry Johan Louwers
 
Enterprise wide publish subscribe with Apache Kafka
Enterprise wide publish subscribe with Apache KafkaEnterprise wide publish subscribe with Apache Kafka
Enterprise wide publish subscribe with Apache KafkaJohan Louwers
 
Industry 4.0 and Oracle Cloud
Industry 4.0 and Oracle CloudIndustry 4.0 and Oracle Cloud
Industry 4.0 and Oracle CloudJohan Louwers
 
Docker and microservices - moving from a monolith to microservices
Docker and microservices - moving from a monolith to microservicesDocker and microservices - moving from a monolith to microservices
Docker and microservices - moving from a monolith to microservicesJohan Louwers
 
Cloud native applications for banking
Cloud native applications for bankingCloud native applications for banking
Cloud native applications for bankingJohan Louwers
 
Conversational retail
Conversational retailConversational retail
Conversational retailJohan Louwers
 
Oracle Cloudday security
Oracle Cloudday securityOracle Cloudday security
Oracle Cloudday securityJohan Louwers
 
Oracle Cloudday - the future of retail
Oracle Cloudday - the future of retailOracle Cloudday - the future of retail
Oracle Cloudday - the future of retailJohan Louwers
 
Capgemini Oracle Cloud Access Security Broker
Capgemini Oracle Cloud Access Security BrokerCapgemini Oracle Cloud Access Security Broker
Capgemini Oracle Cloud Access Security BrokerJohan Louwers
 
Microservices in the oracle cloud
Microservices in the oracle cloudMicroservices in the oracle cloud
Microservices in the oracle cloudJohan Louwers
 
Oracle cloud, private, public and hybrid
Oracle cloud, private, public and hybridOracle cloud, private, public and hybrid
Oracle cloud, private, public and hybridJohan Louwers
 
RethinkDB on Oracle Linux
RethinkDB on Oracle LinuxRethinkDB on Oracle Linux
RethinkDB on Oracle LinuxJohan Louwers
 
Oracle Cloud Hybrid Storage Tiering
Oracle Cloud Hybrid Storage TieringOracle Cloud Hybrid Storage Tiering
Oracle Cloud Hybrid Storage TieringJohan Louwers
 

More from Johan Louwers (20)

Multi Domain REST API routing for Data Mesh based Data Products
Multi Domain REST API routing for Data Mesh based Data ProductsMulti Domain REST API routing for Data Mesh based Data Products
Multi Domain REST API routing for Data Mesh based Data Products
 
TClab Dynamic Solar Panel Positioning Systems
TClab Dynamic Solar Panel Positioning SystemsTClab Dynamic Solar Panel Positioning Systems
TClab Dynamic Solar Panel Positioning Systems
 
Oracle Cloud With Azure DevOps Pipelines
Oracle Cloud With Azure DevOps PipelinesOracle Cloud With Azure DevOps Pipelines
Oracle Cloud With Azure DevOps Pipelines
 
Oracle Cloud native functions - create application from cli
Oracle Cloud native functions - create application from cliOracle Cloud native functions - create application from cli
Oracle Cloud native functions - create application from cli
 
Oracle Labs - research mission & project potfolio
Oracle Labs - research mission & project potfolioOracle Labs - research mission & project potfolio
Oracle Labs - research mission & project potfolio
 
Install Redis on Oracle Linux
Install Redis on Oracle LinuxInstall Redis on Oracle Linux
Install Redis on Oracle Linux
 
Fn project quick installation guide
Fn project quick installation guideFn project quick installation guide
Fn project quick installation guide
 
Voice assistants for the insurance industry
Voice assistants for the insurance industry Voice assistants for the insurance industry
Voice assistants for the insurance industry
 
Enterprise wide publish subscribe with Apache Kafka
Enterprise wide publish subscribe with Apache KafkaEnterprise wide publish subscribe with Apache Kafka
Enterprise wide publish subscribe with Apache Kafka
 
Industry 4.0 and Oracle Cloud
Industry 4.0 and Oracle CloudIndustry 4.0 and Oracle Cloud
Industry 4.0 and Oracle Cloud
 
Docker and microservices - moving from a monolith to microservices
Docker and microservices - moving from a monolith to microservicesDocker and microservices - moving from a monolith to microservices
Docker and microservices - moving from a monolith to microservices
 
Cloud native applications for banking
Cloud native applications for bankingCloud native applications for banking
Cloud native applications for banking
 
Conversational retail
Conversational retailConversational retail
Conversational retail
 
Oracle Cloudday security
Oracle Cloudday securityOracle Cloudday security
Oracle Cloudday security
 
Oracle Cloudday - the future of retail
Oracle Cloudday - the future of retailOracle Cloudday - the future of retail
Oracle Cloudday - the future of retail
 
Capgemini Oracle Cloud Access Security Broker
Capgemini Oracle Cloud Access Security BrokerCapgemini Oracle Cloud Access Security Broker
Capgemini Oracle Cloud Access Security Broker
 
Microservices in the oracle cloud
Microservices in the oracle cloudMicroservices in the oracle cloud
Microservices in the oracle cloud
 
Oracle cloud, private, public and hybrid
Oracle cloud, private, public and hybridOracle cloud, private, public and hybrid
Oracle cloud, private, public and hybrid
 
RethinkDB on Oracle Linux
RethinkDB on Oracle LinuxRethinkDB on Oracle Linux
RethinkDB on Oracle Linux
 
Oracle Cloud Hybrid Storage Tiering
Oracle Cloud Hybrid Storage TieringOracle Cloud Hybrid Storage Tiering
Oracle Cloud Hybrid Storage Tiering
 

Recently uploaded

5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningVitsRangannavar
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 

Recently uploaded (20)

5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learning
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 

import data from Oracle Database into Python Pandas Dataframe

  • 1. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Python Development Example Read data from Oracle Database into Pandas DataFrame Johan Louwers – Chief Customer Architect @ Oracle Version : Feb 2019 @johanlouwers Johanlouwers.blogspot.com Oracle Confidential – Internal/Restricted/Highly Restricted
  • 2. Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Safe Harbor Statement The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. 2
  • 3. Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Python Development with pandas and CX_Oracle Slide-deck Intention : • This presentation is intended to provide a quick introduction example on how to load data from an Oracle Database into pandas. • This example is a part of a wider workshop deck and shared as a stand- alone example for ease of sharing. • The code should only be used as an educational example and is not intended to be included in any real- world application code. 3 Contact details : Johan Louwers - Chief Customer Architect @johanlouwers Johan.louwers@oracle.com github.com/louwersj Johanlouwers.blogspot.com
  • 4. Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | 4 Python Development Pandas – read data from database into DataFrame A B C D 0 A0 B0 C0 D0 1 A1 B1 C1 D1 2 A2 B2 C2 D2 pd.read_sql What do we want to achieve? 1) Read data from an Oracle database into a DataFrame based upon a SQL query. 2) We use cx_Oracle in combination with Oracle Database 18c
  • 5. Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | 5 import pandas as pd import cx_Oracle orclUserName = 'pandas_test' orclPassword = 'pandas_test' orclHost = '192.168.33.10' orclPort = '1521' orclServiceName = 'pdb1' dsn = cx_Oracle.makedsn(host=orclHost, port=orclPort, sid=None, service_name=orclServiceName ) connection = cx_Oracle.connect(user=orclUserName, password=orclPassword, dsn=dsn, encoding="UTF-8", nencoding="UTF-8" ) query = """SELECT * FROM emp""" df_ora = pd.read_sql(query, con=connection) print (df_ora.head()) Import cx_Oracle Provide needed details Define the Data Source Name Define the connection Define the query Execute the read_sql() Python Development Pandas – read data from database into DataFrame
  • 6. Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | 6 Show me the output 1) You can verify the output of df_ora.head() with the content of your database EMP table Python Development Pandas – read data from database into DataFrame
  • 7. Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 7