SlideShare une entreprise Scribd logo
1  sur  4
Télécharger pour lire hors ligne
5/19/2020 Untitled11
localhost:8888/nbconvert/html/Untitled11.ipynb?download=false 1/4
Last Topic Rpy2 Packages (Running R functions on
Python Enviroment)
Fundamental Demonstration in Python Language
Asst. Prof. Ashwini Mathur
Install and load the required packages
In [12]: #conda install -c r rpy2 [Installation of Rpy2 Package]
In [13]: #pip install Ipython
In [14]: import rpy2
In [15]: import rpy2.robjects as robjects
In [16]: #!pip install ipython
import IPython
In [17]: from IPython.display import Image
from IPython.display import display
In [18]: from rpy2.robjects.lib import grdevices
from rpy2.robjects.vectors import IntVector
graphics = robjects.packages.importr('graphics')
In [19]: with grdevices.render_to_bytesio(grdevices.jpeg, width=1024, height=896, res =
150) as img:
graphics.barplot(IntVector((1,2,3,4,5)), ylab='value')
5/19/2020 Untitled11
localhost:8888/nbconvert/html/Untitled11.ipynb?download=false 2/4
In [20]: display(Image(data=img.getvalue(), format='jpeg', embed=True))
Demonstration of GGPLOT2 PACKAGE IN PYTHON PACKAGE
5/19/2020 Untitled11
localhost:8888/nbconvert/html/Untitled11.ipynb?download=false 3/4
In [21]: import rpy2.robjects.lib.ggplot2 as ggplot2
datasets = robjects.packages.importr('datasets')
mtcars = robjects.packages.data(datasets).fetch('mtcars')['mtcars']
mtcars
Out[21]: R/rpy2 DataFrame (32 x 11)
mpg cyl disp ... am gear carb
21.000000 6.000000 160.000000 ... 1.000000 4.000000 4.000000
21.000000 6.000000 160.000000 ... 1.000000 4.000000 4.000000
22.800000 4.000000 108.000000 ... 1.000000 4.000000 1.000000
21.400000 6.000000 258.000000 ... 0.000000 3.000000 1.000000
... ... ... ... ... ... ...
15.800000 8.000000 351.000000 ... 1.000000 5.000000 4.000000
19.700000 6.000000 145.000000 ... 1.000000 5.000000 6.000000
15.000000 8.000000 301.000000 ... 1.000000 5.000000 8.000000
21.400000 4.000000 121.000000 ... 1.000000 4.000000 2.000000
5/19/2020 Untitled11
localhost:8888/nbconvert/html/Untitled11.ipynb?download=false 4/4
In [22]: with grdevices.render_to_bytesio(grdevices.png, width=1024, height=896, res =
150) as img:
gp = ggplot2.ggplot(mtcars)
pp = (
gp
+ ggplot2.aes_string(x = 'wt', y = 'mpg')
+ ggplot2.geom_point(ggplot2.aes_string(colour = 'qsec'))
+ ggplot2.scale_colour_gradient(low='yellow', high = 'red')
+ ggplot2.labs(title = 'Rpy2 ggplot2 MTCARS')
+ ggplot2.theme_bw()
)
pp.plot()
display(Image(data=img.getvalue(), format='png', embed=True))
Enjoy Practicing !!!!

Contenu connexe

Tendances

jimmy hacking (at) Microsoft
jimmy hacking (at) Microsoftjimmy hacking (at) Microsoft
jimmy hacking (at) Microsoft
Jimmy Schementi
 
Two-level Just-in-Time Compilation with One Interpreter and One Engine
Two-level Just-in-Time Compilation with One Interpreter and One EngineTwo-level Just-in-Time Compilation with One Interpreter and One Engine
Two-level Just-in-Time Compilation with One Interpreter and One Engine
Yusuke Izawa
 
[PyCon 2014 APAC] How to integrate python into a scala stack to build realtim...
[PyCon 2014 APAC] How to integrate python into a scala stack to build realtim...[PyCon 2014 APAC] How to integrate python into a scala stack to build realtim...
[PyCon 2014 APAC] How to integrate python into a scala stack to build realtim...
Jerry Chou
 
Stack Hybridization: A Mechanism for Bridging Two Compilation Strategies in a...
Stack Hybridization: A Mechanism for Bridging Two Compilation Strategies in a...Stack Hybridization: A Mechanism for Bridging Two Compilation Strategies in a...
Stack Hybridization: A Mechanism for Bridging Two Compilation Strategies in a...
Yusuke Izawa
 

Tendances (20)

jimmy hacking (at) Microsoft
jimmy hacking (at) Microsoftjimmy hacking (at) Microsoft
jimmy hacking (at) Microsoft
 
Java parallel programming made simple
Java parallel programming made simpleJava parallel programming made simple
Java parallel programming made simple
 
OpenDataPlane Testing in Travis
OpenDataPlane Testing in TravisOpenDataPlane Testing in Travis
OpenDataPlane Testing in Travis
 
Python to scala
Python to scalaPython to scala
Python to scala
 
PyCharm_31
PyCharm_31PyCharm_31
PyCharm_31
 
Código para Latch físico: Touch_calibrate.py
Código para Latch físico: Touch_calibrate.pyCódigo para Latch físico: Touch_calibrate.py
Código para Latch físico: Touch_calibrate.py
 
Two-level Just-in-Time Compilation with One Interpreter and One Engine
Two-level Just-in-Time Compilation with One Interpreter and One EngineTwo-level Just-in-Time Compilation with One Interpreter and One Engine
Two-level Just-in-Time Compilation with One Interpreter and One Engine
 
Two C++ Tools: Compiler Explorer and Cpp Insights
Two C++ Tools: Compiler Explorer and Cpp InsightsTwo C++ Tools: Compiler Explorer and Cpp Insights
Two C++ Tools: Compiler Explorer and Cpp Insights
 
[PyCon 2014 APAC] How to integrate python into a scala stack to build realtim...
[PyCon 2014 APAC] How to integrate python into a scala stack to build realtim...[PyCon 2014 APAC] How to integrate python into a scala stack to build realtim...
[PyCon 2014 APAC] How to integrate python into a scala stack to build realtim...
 
Python Programming Essentials - M24 - math module
Python Programming Essentials - M24 - math modulePython Programming Essentials - M24 - math module
Python Programming Essentials - M24 - math module
 
Stack Hybridization: A Mechanism for Bridging Two Compilation Strategies in a...
Stack Hybridization: A Mechanism for Bridging Two Compilation Strategies in a...Stack Hybridization: A Mechanism for Bridging Two Compilation Strategies in a...
Stack Hybridization: A Mechanism for Bridging Two Compilation Strategies in a...
 
Take advantage of C++ from Python
Take advantage of C++ from PythonTake advantage of C++ from Python
Take advantage of C++ from Python
 
MapReduce
MapReduceMapReduce
MapReduce
 
Mixing C++ & Python II: Pybind11
Mixing C++ & Python II: Pybind11Mixing C++ & Python II: Pybind11
Mixing C++ & Python II: Pybind11
 
Practical no 2
Practical no 2Practical no 2
Practical no 2
 
Notes about moving from python to c++ py contw 2020
Notes about moving from python to c++ py contw 2020Notes about moving from python to c++ py contw 2020
Notes about moving from python to c++ py contw 2020
 
Introduction to OpenCL
Introduction to OpenCLIntroduction to OpenCL
Introduction to OpenCL
 
Profiling in python
Profiling in pythonProfiling in python
Profiling in python
 
From Pylama to Pylava - Susam Pal - PyCon UK 2018
From Pylama to Pylava - Susam Pal - PyCon UK 2018From Pylama to Pylava - Susam Pal - PyCon UK 2018
From Pylama to Pylava - Susam Pal - PyCon UK 2018
 
Functional Programming with JavaScript
Functional Programming with JavaScriptFunctional Programming with JavaScript
Functional Programming with JavaScript
 

Similaire à Rpy2 demonstration

RaVioli: A Parallel Vide Processing Library with Auto Resolution Adjustability
RaVioli: A Parallel Vide Processing Library with Auto Resolution AdjustabilityRaVioli: A Parallel Vide Processing Library with Auto Resolution Adjustability
RaVioli: A Parallel Vide Processing Library with Auto Resolution Adjustability
Matsuo and Tsumura lab.
 
wxFormBuilder - Tutorial on “A GUI for making GUIs” for Python
wxFormBuilder - Tutorial on “A GUI for making GUIs” for PythonwxFormBuilder - Tutorial on “A GUI for making GUIs” for Python
wxFormBuilder - Tutorial on “A GUI for making GUIs” for Python
Umar Yusuf
 

Similaire à Rpy2 demonstration (20)

Gdg cloud taipei ddt meetup #53 buildpack
Gdg cloud taipei ddt meetup #53 buildpackGdg cloud taipei ddt meetup #53 buildpack
Gdg cloud taipei ddt meetup #53 buildpack
 
Lab manual of Digital image processing using python by khalid Shaikh
Lab manual of Digital image processing using python by khalid ShaikhLab manual of Digital image processing using python by khalid Shaikh
Lab manual of Digital image processing using python by khalid Shaikh
 
Raspberry pi pico projects raspberry pi projects
Raspberry pi pico projects raspberry pi projectsRaspberry pi pico projects raspberry pi projects
Raspberry pi pico projects raspberry pi projects
 
Programming Question.docx
Programming Question.docxProgramming Question.docx
Programming Question.docx
 
Front matter: Next Level Front End Deployments on OpenShift
Front matter: Next Level Front End Deployments on OpenShiftFront matter: Next Level Front End Deployments on OpenShift
Front matter: Next Level Front End Deployments on OpenShift
 
RaVioli: A Parallel Vide Processing Library with Auto Resolution Adjustability
RaVioli: A Parallel Vide Processing Library with Auto Resolution AdjustabilityRaVioli: A Parallel Vide Processing Library with Auto Resolution Adjustability
RaVioli: A Parallel Vide Processing Library with Auto Resolution Adjustability
 
Advanced View of Projects Raspberry Pi List - Raspberry PI Projects.pdf
Advanced View of Projects Raspberry Pi List - Raspberry PI Projects.pdfAdvanced View of Projects Raspberry Pi List - Raspberry PI Projects.pdf
Advanced View of Projects Raspberry Pi List - Raspberry PI Projects.pdf
 
Customizing a production pipeline
Customizing a production pipelineCustomizing a production pipeline
Customizing a production pipeline
 
Getting started with open cv in raspberry pi
Getting started with open cv in raspberry piGetting started with open cv in raspberry pi
Getting started with open cv in raspberry pi
 
Rpy package
Rpy packageRpy package
Rpy package
 
Full Stack Visualization: Build A React App With A Sankey Diagram
Full Stack Visualization: Build A React App With A Sankey DiagramFull Stack Visualization: Build A React App With A Sankey Diagram
Full Stack Visualization: Build A React App With A Sankey Diagram
 
Groovy in the Cloud
Groovy in the CloudGroovy in the Cloud
Groovy in the Cloud
 
wxFormBuilder - Tutorial on “A GUI for making GUIs” for Python
wxFormBuilder - Tutorial on “A GUI for making GUIs” for PythonwxFormBuilder - Tutorial on “A GUI for making GUIs” for Python
wxFormBuilder - Tutorial on “A GUI for making GUIs” for Python
 
[Tutorial] Insert a Picture in IBM i Applications with SilverDev
[Tutorial] Insert a Picture in IBM i Applications with SilverDev[Tutorial] Insert a Picture in IBM i Applications with SilverDev
[Tutorial] Insert a Picture in IBM i Applications with SilverDev
 
Docker at OpenDNS
Docker at OpenDNSDocker at OpenDNS
Docker at OpenDNS
 
Advanced View of Projects Raspberry Pi List - Raspberry PI Projects.pdf
Advanced View of Projects Raspberry Pi List - Raspberry PI Projects.pdfAdvanced View of Projects Raspberry Pi List - Raspberry PI Projects.pdf
Advanced View of Projects Raspberry Pi List - Raspberry PI Projects.pdf
 
Build and run embedded apps faster from qt creator with docker
Build and run embedded apps faster from qt creator with dockerBuild and run embedded apps faster from qt creator with docker
Build and run embedded apps faster from qt creator with docker
 
Webinar: Building Embedded Applications from QtCreator with Docker
Webinar: Building Embedded Applications from QtCreator with DockerWebinar: Building Embedded Applications from QtCreator with Docker
Webinar: Building Embedded Applications from QtCreator with Docker
 
Automation of pheromone traps
Automation of pheromone trapsAutomation of pheromone traps
Automation of pheromone traps
 
Python packaging and dependency resolution
Python packaging and dependency resolutionPython packaging and dependency resolution
Python packaging and dependency resolution
 

Plus de Ashwini Mathur

Linear programming optimization in r
Linear programming optimization in r Linear programming optimization in r
Linear programming optimization in r
Ashwini Mathur
 
Introduction to python along with the comparitive analysis with r
Introduction to python   along with the comparitive analysis with r Introduction to python   along with the comparitive analysis with r
Introduction to python along with the comparitive analysis with r
Ashwini Mathur
 
Example 2 summerization notes for descriptive statistics using r
Example   2    summerization notes for descriptive statistics using r Example   2    summerization notes for descriptive statistics using r
Example 2 summerization notes for descriptive statistics using r
Ashwini Mathur
 
Descriptive analytics in r programming language
Descriptive analytics in r programming languageDescriptive analytics in r programming language
Descriptive analytics in r programming language
Ashwini Mathur
 

Plus de Ashwini Mathur (18)

S3 classes and s4 classes
S3 classes and s4 classesS3 classes and s4 classes
S3 classes and s4 classes
 
Summerization notes for descriptive statistics using r
Summerization notes for descriptive statistics using r Summerization notes for descriptive statistics using r
Summerization notes for descriptive statistics using r
 
R programming lab 3 - jupyter notebook
R programming lab   3 - jupyter notebookR programming lab   3 - jupyter notebook
R programming lab 3 - jupyter notebook
 
R programming lab 2 - jupyter notebook
R programming lab   2 - jupyter notebookR programming lab   2 - jupyter notebook
R programming lab 2 - jupyter notebook
 
R programming lab 1 - jupyter notebook
R programming lab   1 - jupyter notebookR programming lab   1 - jupyter notebook
R programming lab 1 - jupyter notebook
 
R for statistics session 1
R for statistics session 1R for statistics session 1
R for statistics session 1
 
R for statistics 2
R for statistics 2R for statistics 2
R for statistics 2
 
Play with matrix in r
Play with matrix in rPlay with matrix in r
Play with matrix in r
 
Object oriented programming in r
Object oriented programming in r Object oriented programming in r
Object oriented programming in r
 
Linear programming optimization in r
Linear programming optimization in r Linear programming optimization in r
Linear programming optimization in r
 
Introduction to python along with the comparitive analysis with r
Introduction to python   along with the comparitive analysis with r Introduction to python   along with the comparitive analysis with r
Introduction to python along with the comparitive analysis with r
 
Example 2 summerization notes for descriptive statistics using r
Example   2    summerization notes for descriptive statistics using r Example   2    summerization notes for descriptive statistics using r
Example 2 summerization notes for descriptive statistics using r
 
Descriptive statistics assignment
Descriptive statistics assignment Descriptive statistics assignment
Descriptive statistics assignment
 
Descriptive analytics in r programming language
Descriptive analytics in r programming languageDescriptive analytics in r programming language
Descriptive analytics in r programming language
 
Data analysis for covid 19
Data analysis for covid 19Data analysis for covid 19
Data analysis for covid 19
 
Correlation and linear regression
Correlation and linear regression Correlation and linear regression
Correlation and linear regression
 
Calling c functions from r programming unit 5
Calling c functions from r programming    unit 5Calling c functions from r programming    unit 5
Calling c functions from r programming unit 5
 
Anova (analysis of variance) test
Anova (analysis of variance) test Anova (analysis of variance) test
Anova (analysis of variance) test
 

Dernier

Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts ServiceCall Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Probability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter LessonsProbability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter Lessons
JoseMangaJr1
 
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Riyadh +966572737505 get cytotec
 
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men 🔝Mathura🔝 Escorts...
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men  🔝Mathura🔝   Escorts...➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men  🔝Mathura🔝   Escorts...
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men 🔝Mathura🔝 Escorts...
amitlee9823
 
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
only4webmaster01
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
amitlee9823
 
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
amitlee9823
 
➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men 🔝mahisagar🔝 Esc...
➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men  🔝mahisagar🔝   Esc...➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men  🔝mahisagar🔝   Esc...
➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men 🔝mahisagar🔝 Esc...
amitlee9823
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
amitlee9823
 
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
karishmasinghjnh
 
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
amitlee9823
 
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
amitlee9823
 

Dernier (20)

Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts ServiceCall Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
 
Probability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter LessonsProbability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter Lessons
 
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
 
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men 🔝Mathura🔝 Escorts...
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men  🔝Mathura🔝   Escorts...➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men  🔝Mathura🔝   Escorts...
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men 🔝Mathura🔝 Escorts...
 
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
 
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Stand
 
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
 
Detecting Credit Card Fraud: A Machine Learning Approach
Detecting Credit Card Fraud: A Machine Learning ApproachDetecting Credit Card Fraud: A Machine Learning Approach
Detecting Credit Card Fraud: A Machine Learning Approach
 
➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men 🔝mahisagar🔝 Esc...
➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men  🔝mahisagar🔝   Esc...➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men  🔝mahisagar🔝   Esc...
➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men 🔝mahisagar🔝 Esc...
 
hybrid Seed Production In Chilli & Capsicum.pptx
hybrid Seed Production In Chilli & Capsicum.pptxhybrid Seed Production In Chilli & Capsicum.pptx
hybrid Seed Production In Chilli & Capsicum.pptx
 
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Research
 
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24  Building Real-Time Pipelines With FLaNKDATA SUMMIT 24  Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
 
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
 
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysis
 
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
 

Rpy2 demonstration

  • 1. 5/19/2020 Untitled11 localhost:8888/nbconvert/html/Untitled11.ipynb?download=false 1/4 Last Topic Rpy2 Packages (Running R functions on Python Enviroment) Fundamental Demonstration in Python Language Asst. Prof. Ashwini Mathur Install and load the required packages In [12]: #conda install -c r rpy2 [Installation of Rpy2 Package] In [13]: #pip install Ipython In [14]: import rpy2 In [15]: import rpy2.robjects as robjects In [16]: #!pip install ipython import IPython In [17]: from IPython.display import Image from IPython.display import display In [18]: from rpy2.robjects.lib import grdevices from rpy2.robjects.vectors import IntVector graphics = robjects.packages.importr('graphics') In [19]: with grdevices.render_to_bytesio(grdevices.jpeg, width=1024, height=896, res = 150) as img: graphics.barplot(IntVector((1,2,3,4,5)), ylab='value')
  • 2. 5/19/2020 Untitled11 localhost:8888/nbconvert/html/Untitled11.ipynb?download=false 2/4 In [20]: display(Image(data=img.getvalue(), format='jpeg', embed=True)) Demonstration of GGPLOT2 PACKAGE IN PYTHON PACKAGE
  • 3. 5/19/2020 Untitled11 localhost:8888/nbconvert/html/Untitled11.ipynb?download=false 3/4 In [21]: import rpy2.robjects.lib.ggplot2 as ggplot2 datasets = robjects.packages.importr('datasets') mtcars = robjects.packages.data(datasets).fetch('mtcars')['mtcars'] mtcars Out[21]: R/rpy2 DataFrame (32 x 11) mpg cyl disp ... am gear carb 21.000000 6.000000 160.000000 ... 1.000000 4.000000 4.000000 21.000000 6.000000 160.000000 ... 1.000000 4.000000 4.000000 22.800000 4.000000 108.000000 ... 1.000000 4.000000 1.000000 21.400000 6.000000 258.000000 ... 0.000000 3.000000 1.000000 ... ... ... ... ... ... ... 15.800000 8.000000 351.000000 ... 1.000000 5.000000 4.000000 19.700000 6.000000 145.000000 ... 1.000000 5.000000 6.000000 15.000000 8.000000 301.000000 ... 1.000000 5.000000 8.000000 21.400000 4.000000 121.000000 ... 1.000000 4.000000 2.000000
  • 4. 5/19/2020 Untitled11 localhost:8888/nbconvert/html/Untitled11.ipynb?download=false 4/4 In [22]: with grdevices.render_to_bytesio(grdevices.png, width=1024, height=896, res = 150) as img: gp = ggplot2.ggplot(mtcars) pp = ( gp + ggplot2.aes_string(x = 'wt', y = 'mpg') + ggplot2.geom_point(ggplot2.aes_string(colour = 'qsec')) + ggplot2.scale_colour_gradient(low='yellow', high = 'red') + ggplot2.labs(title = 'Rpy2 ggplot2 MTCARS') + ggplot2.theme_bw() ) pp.plot() display(Image(data=img.getvalue(), format='png', embed=True)) Enjoy Practicing !!!!