How to Convert a NumPy Array to Pandas Dataframe

NumPy and Pandas are two most useful python toolkits for data analysis. Sometimes you might want to convert a 2d-array in numpy to a dataframe. In this short tutorial, we will learn how to convert a numpy array into Pandas dataframe. Let us first create some numpy array. We will use NumPy’s random module to… Continue reading How to Convert a NumPy Array to Pandas Dataframe

Pandas filter(): Select Columns and Rows by Labels in a Dataframe

In this post, we will learn how to use Pandas filter() function to subset a dataframe based on its column names and row indexes. Pandas has a number of ways to subset a dataframe, but Pandas filter() function differ from others in a key way. Pandas filter() function does not filter a dataframe on its… Continue reading Pandas filter(): Select Columns and Rows by Labels in a Dataframe

How to Convert a Column to Datetime type with Pandas

Pandas in Python has numerous functionalities to deal with time series data. One of the simplest tasks in data analysis is to convert date variable that is stored as string type or common object type in in Pandas dataframe to a datetime type variable. In this post we will see two ways to convert a… Continue reading How to Convert a Column to Datetime type with Pandas

How To Code a Character Variable into Integer in Pandas

How to Code Character Variable as Integers with Pandas?

Often while working with a Pandas dataframe containing variables of different datatypes, one might want to convert a specific character/string/Categorical variable into a numerical variable. One of the uses of such conversion is that it enables us to quickly perform correlative analysis. In this post, we will see multiple examples of converting character variable into… Continue reading How To Code a Character Variable into Integer in Pandas