what is pandasgui?
pandasgui is a GUI-Graphical User Interface that helps in visualising a given pandas DataFrame.(A pandas DataFrame can be obtained from an input dataset).
using pandasgui one can perform many tasks such as statistical analysis, querying a dataframe i.e applying filters to a DataFrame, plotting various types of graphs(line,, box,bar, histogram, etc), reshaping the DataFrame and other tasks too
As like many other GUI it has also drag and drop feature.
It can be run from a python script or python IDLE or a terminal or an IDE.
In this article I will be using python IDLE only.
InstallaiNg pandasgui:
open your operating system's terminal and type
pip install pandasgui
This should download the pandasgui on to your workspace and all it's dependencies.
Usage:
On typing the below code the GUI window of pandasgui will open up.
Here the DataFrame tab shows the pandas DataFrame similar to how a jupyter notebook would show it.
The values in the DataFrame can also be edited.
This is an important feature as otherwise we would have to write code for it.
We can also copy our dataset on to a notepad.
The filter tab can be used to filter or query the DataFrame as per the need of the user.
For example here I have use A>5 as a query.
.
Now the DataFrame tab will show only those rows which have values of variables in column A are greater than 5.

The Statistics tab will show the statistical analysis of the DataFrame at all times.
It would include values like mean, standard deviation, etc.
While using pandas we have to write code for each one of these but pandasgui would show it at all times.

The grapher tab is built over plotly library of python.
Grapher tab has many plotting options as shown below.
In the tab below it has options for other arguments or inputs for the graphs in the "Name" section.
Here I plotted a line graph depicting how values of A, B, C would change with respect to D.

The reshaper tab is used to create a new "reshaped" DataFrame.
It doesn't remove the current DataFrame.
The reshaper tab has two options like pivot and melt.
We will understand them in more detail with the following example.
Working with a real Dataset:
Here we will use "pokemon" dataset that comes built in with pandasgui,
This dataset has all the info about pokemons like their HP,Attacks<type,etc.
Code for using inbuilt-dataset :
From pandasgui.datasets import pokemon
show(pokemon)
here "pokemon" is already a pandas DataFrame but for a new dataset file we would have to convert it using pandas library.
One more feature of pandasgui is that clicking on any of the columns would sort the values in the DataFrame as per that column in ascending order and clicking again would sort it in descending order.
Here I have sorted the dataset as per "Generation " Column.
Using filter tab we can query results as per our need.
here I used a query "Attack>150" to get only those rows with value of attack greater than 150.
Using grapher tab I plotted a line graph for pokemons with attack greater than 150 to get a relation between values of special defense and Speed.
Here we can see that if the speed of a pokemon is beyond 120 it's value of sp.defense decreases steeply.
Reshaper tab can be used to reshape a given dataframe.
Here using the pivot method I created a reshaped copy of the DataFrame with "#" column as the index.
The newly created DataFrame should look like this.
This pivoted DataFrame will depend on the snapshot of the original Dataframe at the time of making the new one.
So this includes only those rows which had Attack>150.
Another method is melt method which is a more simpler and novice one.
It takes two arguments "id_vars" and "value_vars".
As can be seen in the "Names" tab below.
The resulting DataFrame would look like this.
Comments