A Python Pandas rule of thumb: Wherever you can use a column name (string), you can use multiple column names (a list of strings):
To sort a Python Pandas data frame by column x: By x and y (ascending): By x and y, both descending: Ascending x, descending y:
Need specific column types in Python Pandas? Use select_dtypes:
Python Jupyter memory quirk: Deleting variables doesn’t always free memory! Use df.head() instead of df to keep big values out of Jupyter’s Out dict.
I’ve been teaching Python and Pandas for decades — in companies, at conferences, and on YouTube — and I keep hearing the same frustrations everywhere I go: That’s why I’ve spent the last few months completely rebuilding LernerPython.com. It’s a complete, structured learning experience, not just a set of courses. Instead of leaving you on…
Data is the future. Heck, you could make a compelling argument that it’s the present. If you know how to work with data, then your career is virtually assured. You’ll have your pick of cool jobs, interesting projects, good employers, and smart colleagues. Even better? The most popular language for working with data is Python.…
Python and Pandas can improve your career. I say this all the time, partly because it’s my job (as a Python/Pandas trainer), and partly because I’ve seen how people’s lives and careers can improve with this knowledge. But what if you’re already familiar with Python and Pandas? The good news (and bad news, for that…
I’ve been blogging a lot less lately, in part because I’ve been writing more on Twitter and recording more YouTube videos. Among those YouTube videos are: Intro to Python exceptions, https://www.youtube.com/watch?v=ilJfD65d-2Q “for” loops vs list comprehensions, https://www.youtube.com/watch?v=dY8lD_fk0r4 Understanding the “if __name__ == ‘__main__’” line in Python modules: https://www.youtube.com/watch?v=sf3vENkPKj8 All about Python identifiers: https://www.youtube.com/watch?v=CTxLVMFkbT8 Peeking at…
As you might know, I’ve been working lately on my new book, Pandas Workout, with 50 exercises to improve your fluency using the “pandas” library for data analysis. Well, I have exciting news: The book is now available as a MEAP, aka the “Manning Early Access Program.” This means that if you buy the book…
I teach Ruby and Python to a lot of people — in formal courses, and in one-on-one pairing sessions, both online and in person. I’ve found that for many people, the whole notion of functional programming seems strange and difficult, as well as something of a waste of time. After all, if you have objects,…