Which Do You Prefer R or Python?

Interested in the general sentiment here. Could be for quant, discretionary, any investing role honestly. 

I have found that PhD folks tend to lean R. Also, older individuals in general tend to prefer R. But Python has gained alot of traction over the last decade & younger folks usually prefer it. 

I know neither is "better." Since they can both accomplish the majority of the same goals. Anyways, interested in your opinions when it comes to programming tools among investment professionals. 

Hedge Fund Interview Course

  • 814 questions across 165 hedge funds. Crowdsourced from over 500,000 members.
  • 11 Detailed Sample Pitches and 10+ hours of video.
  • Trusted by over 1,000 aspiring hedge fund professionals just like you.

Comments (18)

  • Analyst 2 in IB - Cov
Sep 2, 2021 - 9:31pm

Python for sure. R is used mostly by academics as you pointed out, while Python is used in industry. You can also do more with python beyond just data analysis/ML that would be quite cumbersome in R.

Sep 2, 2021 - 9:33pm

R is really only used for stats stuff. Python is a lot more flexible/useful IMO. Even a small amount of python can be incredibly useful and save you a lot of time.

  • Prospect in IB-M&A
Sep 2, 2021 - 10:06pm

I like the tidyverse packages in R, but python wins by sheer number of libraries.

Most Helpful
Sep 3, 2021 - 9:30am

Python is a completely below-average programming language that people have co-opted for data science for some godforsaken reason, despite it being verbose and clunky.

R is full of warts and weird legacy cruft that you have to learn and work around, but it flat-out wins on the one dimension that actually matters: being able to work with data. It's terse; it lets you introspect, slice, and dice data quickly; and its data-processing libraries are substantially faster to run than their Python equivalents. The magic of R is its terseness. Because you can do so much in so few keystrokes, your mental overhead to exploring your data is near-zero, and exploring your data is the most important thing in data science.

R is definitely a statistics-first language, but I've done things like web scraping, process automation, and interactive web servers in it.

I think the question is, what is your goal? If you want to learn a first coding language, Python over R. If you are worried about broad applicability (i.e. you want to become a software engineer), pick a general-purpose software engineering language such as Java (or dare I say it, Go). If you want to be a data scientist in finance...well, you should still learn Python, if only because more and more firms are using Python these days. But R is this awesome-kept secret that not enough people appreciate. It's a shame. I feel like Paul Graham yelling about how Lisp is the one true programming language. Oh well.

Learn More

300+ video lessons across 6 modeling courses taught by elite practitioners at the top investment banks and private equity funds -- Excel Modeling -- Financial Statement Modeling -- M&A Modeling -- LBO Modeling -- DCF and Valuation Modeling -- ALL INCLUDED + 2 Huge Bonuses.

Learn more
  • Analyst 1 in IB - Gen
Sep 5, 2021 - 2:53pm

R is generally faster, & more accessible when it comes to anything statistical aswell as data visualization. 

You can do basically anything in R on Python, but it involves more lines of code and is less straightforward. So, in a real world scenario why not just use the faster program to accomplish the same results with fewer headaches? 

That said, Python is a general purpose programming language that can in theory accomplish everything. Whereas R is best for Data analysis, visualization, statistics, automation & with packages ML. Relistically, if you are in PE or at a discretionary fund, I cannot think of a single reason why you would need Python over R. 

However, if you are a quant and are writing algorithms, then it makes sense to lean Python. 

Sep 4, 2021 - 1:33am

Magni aut earum enim sit aperiam atque adipisci odit. A labore quia assumenda aperiam veritatis excepturi eveniet. In autem nesciunt maiores qui.

Start Discussion

Total Avg Compensation

September 2021 Hedge Fund

  • Vice President (19) $498
  • Director/MD (10) $359
  • NA (5) $306
  • Portfolio Manager (7) $297
  • Manager (4) $282
  • 3rd+ Year Associate (19) $272
  • 2nd Year Associate (28) $241
  • Engineer/Quant (51) $237
  • 1st Year Associate (64) $187
  • Analysts (188) $168
  • Intern/Summer Associate (15) $125
  • Junior Trader (5) $102
  • Intern/Summer Analyst (211) $82