PandasGUI: Analyzing Pandas dataframes with a Graphical User Interface | by Parul Pandey | Towards Data Science

Today the pandas library has become the defacto tool for doing any exploratory data analysis in Python. Its versatility, flexibility, and ease of use makes it the library of choice for many data scientists today. The pandas' library also enjoys excellent community support and thus is always under active development and improvement. Due to this indispensable nature of pandas, various tools have been created from time to time to enhance its effectiveness or improve upon it. There are two specific sets of tools that I have encountered when it comes to pandas:
Tools that can perform basic EDA in two or three lines of code. These libraries essentially use pandas’ functions under the hood. Examples are SweetViz and Pandas profiling library.
GUI-based alternatives to pandas, for example, Bamboolib.
Recently, I came across another GUI based alternative to pandas called PandasGUI. One thing that struck was that it offered capabilities of plotting as well as reframing the dataframe. Also, the user has the freedom to perform custom operations too. This article will try and explain its various features and functionalities and how you could use it for your data.
PandasGUI, as the name suggests, is a graphical user interface for analyzing Pandas’ dataframes. The project is still under active development and so can be subject to breaking changes, at times. PandasGUI comes with many useful features, which we shall cover in detail later in the article. Before that, let’s see how we can install the library and get it running.
There are a couple of ways by which you can install PandasGUI:
# from PyPipip install pandasguior# from Githubpip install git+https://github.com/adamerose/pandasgui.git
Let’s now look at the various capabilities of the PandasGUI library with an example. PandasGUI comes with some example datasets already. So we’ll use the Titanic dataset, which comes packaged with the library. Titanic is a fairly known ‘Hello World’ dataset in machine learning, where the task is to create a model that predicts which passengers survived the Titanic shipwreck.
import pandas as pdfrom pandasgui import showfrom pandasgui.datasets import titanicgui = show(titanic)
In case you want to import your dataset, you can do so as follows:
titanic = pd.read_csv('https://github.com/adamerose/datasets/blob/master/titanic.csv')gui = show(titanic)
Once you run the above commands, a separate window opens up and displays the uploaded dataframe:
Let’s now look at the various offerings of this tool one by one.
You can view the entire imported dataframes and then quickly sort them in ascending or descending order. Note that PandasGUI can handle multiclass datarfames also.
Once you have explored the dataset, you can even filter the dataset based on some query expressions. Dataframe.query() is a method originally provided by pandas for performing filtering operations. It takes an expression in string form to filter data, makes changes to the original dataframe, and returns the filtered dataframe.
For our dataset, let’s say we want to filter the entire data for passengers who are:
Male
Belong to Pclass 3, and
Survived the shipwreck.
Another great feature of this tool is that you can directly edit any entry and even copy and paste the selected data to another environment like excel or notepad.
PandasGUI also provides a condensed statistical overview of the entire dataset.
Data Visualisation is an essential part of any data analysis process, and PandasGUI provides several options to quickly create some cool interactive charts like:
Below we have created a pie-chart, a bar chart, and even a word cloud. Since the charts are created in plotly, they are responsive as well as interactive.
Sometimes, there is a need to reshape the data to get more distinct insights. PandasGUI provides two functions — pivot and melts to achieve the same. Let’s see how to pivot the data via this tool.
Another cool property of the tool is that one can simply import a dataframe by dragging it on to the GUI interface, which is handy at times.
If you have directly imported a dataframe onto the PandasGUI interface, you can access the same in the familiar juptyer notebook also, with just a few lines of code. From there, you can carry the data analysis process in the notebook itself, if you wish.
In this article, we looked at a GUI-based tool for analyzing pandas dataframes. This tool has a number of interesting features like filtering, sorting, visualizing, and even aggregating, which we saw in detail with an example dataset. Since PandasGUI is under active development, we might see some more features in the coming days. Such libraries can be a boon for people who are not very comfortable with coding or are looking for a low code environment. Whatever the ultimate goal is, it is always good to know about another open-source tool to add to our data science toolkit.