Chapter 3. Python for UseRs

Welcome, brave useR, to the wonderful world of the Pythonista! For many useRs, this brave new world may appear more varied—and thus more inconsistent and confusing—than what they’re used to in R. But don’t fret over diversity—celebrate it! In this chapter, I’ll help you navigate through the rich and diverse Python jungle, highlighting various paths (workflows) that your Python-using colleagues may have taken and that you may choose to explore later on. Meanwhile, know that you’ll eventually find the path that best suits you and your work environment; this will change over time and may not be the one outlined here. Like any good trek, use this route as a guide, not a rule book.

I’ll cover the essentials of the four elements I mentioned in the introduction to this part: functions, objects, logical expressions, and indexing. But I’ll begin by addressing three questions:

Question 1

Which version and build (distribution) to use? There are a few different versions and builds of Python to choose from, in contrast to R.

Question 2

Which tools to use? The wide variety of IDEs, text editors, and notebooks, plus the many ways of implementing virtual environments, adds more choices to make.

Question 3

How does Python the language compare to R the language? Wrapping your head around an OOP-centric world, with a host of classes, methods, functions, and keywords provides another barrier to entry.

I’ll address each of these questions in turn. ...

Get Python and R for the Modern Data Scientist now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.