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 […]
Pandas 101
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 […]
How To Delete Rows in Pandas Dataframe
Pandas make it easy to delete rows of a dataframe. There are multiple way to delete rows or select rows from a dataframe. In this post, we will see how to use drop() function to drop rows in Pandas by index names or index location.. Pandas drop() function can also be used drop or delete […]
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 […]
How To Code a Character Variable into Integer in 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 […]