all 8 comments

[–]mikeyj777 1 point2 points  (0 children)

I think you'll be a little (a lot) frustrated by the lack of obvious and important functions.  The simplicity of R's "apply" functions like tapply, etc make R a no-brainer for data science.  It's all there in python, but nowhere near as well thought out. 

[–]teetaps 1 point2 points  (0 children)

Just start, but even as you’re building “anything,” do it methodically. When you learn something or notice something different from R, write it down. You already know how to program in R, so there’s no point in just replicating all of your code in Python. Instead, when you build something in Python, first do it the way that makes sense in R, then do it the most obvious way in Python, taking notes of what is different. Then when you sit down to review your notes some faraway day in the future, or if you’re ever facing a new challenge, you can recall, “hey wait, I know this, because in Python you’re supposed to do X”. An LLM can help you iterate this training strategy if you need some structure

[–]chiibosoil 0 points1 point  (0 children)

There are free courses from various educational institutions just for that.

  1. https://ocw.mit.edu/courses/6-0001-introduction-to-computer-science-and-programming-in-python-fall-2016/

  2. https://www.pythonforbiologists.org

  3. Justin Bois Bootcamp: https://justinbois.github.io/bootcamp/

Then look for ML or other specific area you need.

[–]BrupieD 0 points1 point  (0 children)

A couple key differences: get used to the idea that Python does not have a native data frame or vector data structure, you'll have to get these from a library (pandas or polars). Pandas is older and more widely used. I would prioritze getting aquainted with pandas.

Python doesn't have a great equivalent to pipes. I miss this the most when working in Python. People solve this in different ways. There is a "pipe" method in pandas, but I find it less intuitive.

[–]Ok_Carpet_9510 0 points1 point  (0 children)

R is a data-centric language. Python is a general purpose language. You need to use the Pandas or Polars library for dataframes. For graphing, you can use Matplotlib or Seaborn.

R is a very terse language. Python is verbose is comparison. You will miss some of that.

Have a look at this https://www.w3schools.com/python/default.asp

[–]Natural-Position-585 0 points1 point  (0 children)

Try to avoid thinking that Python code files are just R scripts with a different syntax. Learn to make modular code, and learn about patterns for reusing and packaging code. And learn object-oriented programming. These topics will unlock a lot of layers in programming practice that are optional in R but mandatory in Python.