rpy2

Multidimensional/multivariate dynamic time warping (DTW) library/code in Python

那年仲夏 提交于 2020-06-09 18:05:54
问题 I am working on a time series data. The data available is multi-variate. So for every instance of time there are three data points available. Format: | X | Y | Z | So one time series data in above format would be generated real time. I am trying to find a good match of this real time generated time series within another time series base data, which is already stored (which is much larger in size and was collected at a different frequency). If I apply standard DTW to each of the series (X,Y,Z)

How to use `hclust` function from R in Python via Rpy2 (v3)?

≡放荡痞女 提交于 2020-06-01 04:22:11
问题 There are a lot of changes between rpy2 v2 and v3. I'm porting my code and patching up some compatibility issues. One thing I can't figure out is how to get hclust to work. Specifically from the fastcluster package but I can't even get base hclust to work. A few things I do not understand: (1) Should I use R["as.dist"](rkernel) or R("as.dist")(rkernel) ? (2) Why does this return a numpy array when I'm calling it within R? (3) How can I get this disimilarity object to work with hclust and

Rpy2: calling to function conaining dots

微笑、不失礼 提交于 2020-05-28 09:48:55
问题 I'm tring to run a R function in Pyton via Jupyter Notebook. the problem is, that my function name (from mice lib) - containing dot. the name of the function is md.pattern , and this is the code that I'm tring to run: from rpy2.robjects.packages import importr mice = importr('mice') mice.md.pattern(train) and this is the error that I get: AttributeError: module 'mice' has no attribute 'md' I also tried to run: from rpy2.robjects.packages import importr mice = importr('mice') pattern =

Rpy2: calling to function conaining dots

五迷三道 提交于 2020-05-28 09:45:31
问题 I'm tring to run a R function in Pyton via Jupyter Notebook. the problem is, that my function name (from mice lib) - containing dot. the name of the function is md.pattern , and this is the code that I'm tring to run: from rpy2.robjects.packages import importr mice = importr('mice') mice.md.pattern(train) and this is the error that I get: AttributeError: module 'mice' has no attribute 'md' I also tried to run: from rpy2.robjects.packages import importr mice = importr('mice') pattern =

Rpy2: calling to function conaining dots

自闭症网瘾萝莉.ら 提交于 2020-05-28 09:42:36
问题 I'm tring to run a R function in Pyton via Jupyter Notebook. the problem is, that my function name (from mice lib) - containing dot. the name of the function is md.pattern , and this is the code that I'm tring to run: from rpy2.robjects.packages import importr mice = importr('mice') mice.md.pattern(train) and this is the error that I get: AttributeError: module 'mice' has no attribute 'md' I also tried to run: from rpy2.robjects.packages import importr mice = importr('mice') pattern =

Using R in Python with Rpy2: how to ggplot2?

孤者浪人 提交于 2020-05-13 06:20:48
问题 Hi guys I'm trying to use R in Python and I found Rpy2 very interesting. It is powerful and not that difficult to use, however even if I have read the documentation and looked for a similar question, I wasn't able to solve my problem with the ggplot2 library. Basically I have a dataset with 2 columns, 11 rows and no header and I would like to do a scatter plot using this R code from Python: ggplot(dataset,aes(dataset$V1, dataset$V2))+geom_point()+scale_color_gradient(low="yellow",high="red")

Using R in Python with Rpy2: how to ggplot2?

 ̄綄美尐妖づ 提交于 2020-05-13 06:20:07
问题 Hi guys I'm trying to use R in Python and I found Rpy2 very interesting. It is powerful and not that difficult to use, however even if I have read the documentation and looked for a similar question, I wasn't able to solve my problem with the ggplot2 library. Basically I have a dataset with 2 columns, 11 rows and no header and I would like to do a scatter plot using this R code from Python: ggplot(dataset,aes(dataset$V1, dataset$V2))+geom_point()+scale_color_gradient(low="yellow",high="red")

How to extract 'RS4' element in Rpy2

天大地大妈咪最大 提交于 2020-04-30 16:02:43
问题 I’m a Chinese reader of book “Applied Spatial Data Analysis with R”, which is very useful for spatial analysis work. I tried to translate the R code into python with the Rpy2, since python can handle more complex data sources. But I have a problem with the Rpy2 code. The NY8 data is attached with the email. The R code is: library(rgdal) NY8<-readOGR(".","NY8_utm18") Syracuse<-NY8[NY8$AREANAME=="Syracuse city",] Sy2_nb<-poly2nb(Syracuse,queen=FALSE) library(spdep) Sy2_nb<-poly2nb(Syracuse

How to extract 'RS4' element in Rpy2

风流意气都作罢 提交于 2020-04-30 16:01:27
问题 I’m a Chinese reader of book “Applied Spatial Data Analysis with R”, which is very useful for spatial analysis work. I tried to translate the R code into python with the Rpy2, since python can handle more complex data sources. But I have a problem with the Rpy2 code. The NY8 data is attached with the email. The R code is: library(rgdal) NY8<-readOGR(".","NY8_utm18") Syracuse<-NY8[NY8$AREANAME=="Syracuse city",] Sy2_nb<-poly2nb(Syracuse,queen=FALSE) library(spdep) Sy2_nb<-poly2nb(Syracuse

Why does Pip disregard configured repository with nested dependencies?

穿精又带淫゛_ 提交于 2020-02-25 03:41:56
问题 Problem Let us say I have a completely empty Python+Pip+R (pip 19.3.1) environment on a Linux machine and I want to install the package rpy2 with pip. Since I am behind a corporate firewall I configure pip to use a private repository. [global] index-url = http://private.com/artifactory/api/pypi/PyPI/simple trusted-host = private.com Now I execute pip install rpy2 and I will get back the following error: Couldn't find index page for 'cffi' Download error on https://pypi.python.org/simple/ So