Pandas#


No, not a panda like a panda bear 🐼!

pandas is a library that we will use to simplify much of our CSV processing. We learned the list of dictionaries approach since it is a useful exercise in working with data structures (which you will commonly do as a data programmer), but when it comes to CSV processing, pandas is by far the most popular way of interacting with your data.

A library is some code that someone else wrote, that you can install on your computer and use in your code so you don’t have to reimplement everything yourself. pandas is one such library that we will learn, but we will learn many more!

Context on Learning Libraries#

The next slide shows an example Jupyter Notebook that shows how to use pandas . Before we show that, let us give some context that pandas code looks a bit funky at first because it’s so short. It will also feel like there is a TON of information coming at you (because there is). pandas is a powerful library that allows you to do a ton of computation with relatively little code. Even though the syntax does look a little weird at first, remember you get better at this with practice .

Kind of like when learning Python, we aren’t going to show you EVERYTHING you can possibly do with the library (there is just far too much). Instead, we show you lots of targeted examples and the idea is you will able to look back at those and figure out how to modify them to solve the problem at hand.

You might find yourself looking back at this reading frequently to double-check syntax. While we hope you find these readings helpful, it is incredibly important to try to synthesize these ideas in your own mental model. So after reading this, we recommend trying to make your own reference sheet of the ideas and syntax you learned and actually use that reference sheet when trying to solve practice problems. If you find your reference sheet was missing something important that made it difficult to solve a particular problem, go back and add that to the reference sheet. It might also help to have example snippets of code in your reference sheet!