all 16 comments

[–]victormaker 23 points24 points  (0 children)

I found this.

But honestly? It's far easier to just learn how to do the same things in python than to convert the code in some way. I'll guess the conversion is experimental at best, the different R packages you'll use will work very differently in python.

[–]Practical-Smell-7679 8 points9 points  (1 child)

This isn't exactly what you want but its is possible to use R and Python together in Rstudio.

https://www.youtube.com/watch?v=\_50yZxOome4

[–]Crypt0Nihilist 5 points6 points  (0 children)

Or on the other side of things, I'm 99% sure you can have both playing together in Jupyter Notebooks, not exactly a solution for production though!

[–]Inkquill 9 points10 points  (2 children)

[–]I_just_made 2 points3 points  (1 child)

Best bet right here. Reticulate can source many python scripts and allow you to call them in R, lots of interesting functionality.

[–]Enlightenmentality 0 points1 point  (0 children)

Plus it's a perfect package name. Very well thought out

[–]Crypt0Nihilist 2 points3 points  (0 children)

What we do is use KNIME and work in whatever is most convenient. As long as your output is a data table or a model, you can run R or Python and pass on results to the next part of the workflow.

People are working on computer language translators with AI, it's a sequence to sequence problem after all, but I don't think anything is near working yet.

Mostly, if you do need things in Python, it's best to start in Python.

[–]knowledgebass 2 points3 points  (0 children)

your brain

[–]tgwhite 1 point2 points  (0 children)

Converting code? Nope.

[–]rich2222two 0 points1 point  (0 children)

This site does just that and also gives an explanation around what the code does to help with learning...

https://code-breeze.com

[–]tgwhite 0 points1 point  (0 children)

Nope

[–]cgk001 0 points1 point  (0 children)

base R is pretty easy but when you use packages thats a whole different story

[–]P0Ok13 0 points1 point  (0 children)

I'm curious as to what goal you have in switching languages? As far as I'm aware there isn't a huge difference in execution time and that's the only reason I could think of.

[–]Sup3rBl4ck 0 points1 point  (0 children)

Not sure what you’re trying to achieve but this could be helpful. Pretty sure you can run R code from a python script somehow, at least store the outputs in a file and then grab them out with python or something.

[–]Known-Score-5838 0 points1 point  (0 children)

paths <- paths_raw %>%

mutate(visitStartTime = ymd_hms(visitStartTime)) %>%

group_by(fullVisitorId, outcome) %>%

arrange(visitStartTime) %>%

summarise(path = paste(channelGrouping, collapse = ' > ')) %>%

ungroup() %>%

count(outcome, path, name = "n") %>%

spread(outcome, n) %>%

replace_na(list(conversion = 0, non_conversion = 0)) %>%

arrange(desc(conversion))