Indexing time series data in pandas is similar to other types, but there are a number of convenient functions unique to time series.
One of the most searched for (and discussed) questions about pandas is how to iterate over rows in a DataFrame. Often this question comes up right away for new users who have loaded some data into a DataFrame and now want to do something useful with it. The natural way for most programmers to think … Continue reading How to iterate over DataFrame rows (and should you?)
Jupyter notebooks are a popular way to share data and code, and there are multiple ways to run and edit notebooks.
Jupyter widgets can make notebooks be more interactive and make data exploration much easier, especially for end users who are not coders.
When your Python program uses more memory than expected, you can use memory_profiler to find out where memory is allocated.
Jupyter notebooks can easily have hidden state. Use these methods to see all the variables that exist in your Jupyter notebooks.
Using the %autoreload magic in IPython or Jupyter can help you continue working without restarting your session after making local changes.
It is possible to unit test Python code that lives in a Jupyter notebook. This article looks at three reasonable choices.
You can use py-spy to profile already running Python code without restarting your process or modifying the source code.
Removing one or more columns from a pandas DataFrame is a pretty common task, but it turns out there are a number of possible ways to perform this task. I found that this StackOverflow question, along with solutions and discussion in it raised a number of interesting topics. It is worth digging in a little bit to the … Continue reading How to remove a column from a DataFrame, with some extra detail