How to convert Pandas DataFrame columns to string type?

In today’s Pandas Data Analysis tutorial i would like to cover the basics of Python DataFrame column conversion to strings. We will focus on several key use cases here: Converting specific columns to strings using the astype() method. Exporting a DataFrame to a string object Converting a Datetime object to a string Example data We … Read more

How to pip install the requests module to solve import errors?

Couple days ago i installed a clean Python3.X environment using MiniConda. After launching Jupyter Lab and trying to start working with the requests module, i got an import error. In this post i will show you how to easily troubleshoot requests import errors in your Python development environment of choice, being it Jupyter, PyCharm, Spyder … Read more

Adding new rows to Pandas DataFrames: from list, from dictionary, from Series

In this tutorial we’ll cover everything you might need in order to add new rows into an existing DataFrame. We’ll look specifically into a step-by-step process to append lists, dictionaries and Pandas Series objects into DataFrames. 1. Preparing the Data We’ll first start by defining a few data objects that we’ll use throughout our examples. … Read more

How to modify values in a Pandas DataFrame?

As part of our data wrangling process, we are often required to modify data previously acquired from a csv, text, json, API, database or other data source. In this short tutorial we would like to discuss the basics of replacing/changing/updating manipulation inside Pandas DataFrames. Replace specific data in Pandas DataFrames In this tutorial we will … Read more

Troubleshoot No module named Pandas errors in Python

When setting up our Python data analysis environments on Windows, MAC or Linux and getting started with our coding we might encounter import errors.These errors originate from the fact that specific packages we call in our Python code (wrote using Jupyter Lab or Notebooks, Spyder, PyCharm, VSCode or other development environment your might be using) … Read more