Category: Python
-
Analyzing COVID-19 Data
I’ll be analyzing COVID-19 data in a Jupyter Notebook for this post.
-
COVID-19 Dashboard
This dashboard is using data from the COVID Tracking Project. The dashboard is built using Python and Flask. The visualizations are made using Plotly and the Dash framework. The app is hosted on AWS Beanstalk.
-
How to Check for NaN Values when Applying a Function on a DataFrame
Nan values in a Pandas DataFrame can be tricky to work with. In this post, I’ll show you how to correctly account for them when writing a function with conditionals.
-
How to Quickly and Easily get a List of Week-end, Month-end, or Year-end Dates in Python
Getting month-end, or any other interval can be cumbersome. In this post, I’ll show you how to generate a list of dates quickly in Python.
-
How to Export a Pandas DataFrame to an HTML Table and Add Custom Styling or CSS Classes
Using the built-in Pandas function to export a DataFrame to an HTML table is quick way to export your DataFrame but it does has some limitations. Using a for loop to create your HTML table allows you to add any custom styling or CSS classes for enhanced formatting. In this post, I’ll walk you through…
-
How to Run Multiple Aggregations on the same Column when using Pandas GroupBy
Running multiple aggregations when grouping a Pandas DataFrame can be accomplished using the .agg function and passing in a dictionary. In this post, I’ll show you how to do that.
-
How to Flatten MultiIndex Columns into a Single Index DataFrame in Pandas
Sometimes it’s just easier to work with a single-level index in a DataFrame. In this post, I’ll show you a trick to flatten out MultiIndex Pandas columns to create a single index DataFrame.
-
How to Refresh an Imported Python File in a Jupyter Notebook
If you have imported a python file and later make changes to it, you’ll need to reload it in your Jupyter Notebook to take advantage of any recent changes.
-
Creating a Random or Test DataFrame in Pandas
Having random or test data is a great way to test out various functions before applying them to actual data. Here are a few ways to generate random or test data in pandas.
-
How to Combine Multiple Excel Files using Python
Easily and quickly combine multiple excel files that contain the same type of data.