Jupyter Notebook Without Code — The Mito Way | by Yong Cui | Towards Data Science

The first comprehensive statistical analysis software that I used was SAS, and it wasn’t easy to get it started with SAS, because it has its own syntax that I had to learn before I was able to do anything with it. Certainly, after I learned it, it became pretty handy, because you can re-use the code in your projects.
Later, I came across SPSS, another kind of commonly used statistical software. This software is basically point-and-click, and you do your data processing and analysis in a GUI. One particularly useful feature is the automatic creation of the script based on the operations that you’ve done. With the generated script, you can simply apply it to other similarly structured datasets.
For beginners, it seems easier to pick up SPSS, because point-and-click is more intuitive compared to writing code in SAS, particularly if you don’t have any programming experience.
The last several paragraphs are the thoughts that came to my mind when I first encountered mito, which is a Jupyter-based tool that prepares and presents your data using a point-and-click approach. Just like SPSS, it can generate the code based on the operations that you’ve done. Thus, maybe for data science beginners with less code experience, mito is a good place to start with.
Wait a second. What does mito do exactly? Let’s explore it in this article.
Before you jump into this tutorial, let’s assume the following things such that we’re on the same page.
Have already installed Python on your computer. Please also make sure your Python’s version is 3.6+. In your terminal, you can check it using: python — version.
Have experience using Jupyter Notebook. For a better notebook experience, please also make sure you install jupyter lab.
Know how to set up a virtual environment. A good tool is conda, and see my article for its instruction.
In the terminal, enter the following command to install the installer.
python -m pip install mitoinstaller
Then, you can use the installer to install the mito library by running:
python -m mitoinstaller install
In the terminal, after activating the desired virtual environment, you can launch jupyter lab by running jupyter lab. You’ll see that the jupyter server is running in your default web browser.
Create a notebook and in the cell, enter the following lines of code, which will create a mito sheet for you.
import mitosheetmitosheet.sheet()
Please note that you’ll have to sign up using your email before you can proceed. You’ll then be prompted to choose a file to import. For this tutorial, let’s use the mpg dataset that is available as part of the seaborn’s datasets. After the import, you’ll see the sheet-like below. One thing that is useful is that the shape of the dataset is shown in the right corner at the bottom. So you’ll have a reasonable idea whether the import of the file is correct.
As you can tell, the overall appearance of this sheet is very clean. Personally, I like the font and its size, and they’re just pleasing to the eyes.
As mentioned at the beginning, mito has the capability of automatically generating code for the step you’ve just done. So after importing the dataset, you’ll see a cell with the code appear below the current cell.
Everything should be straightforward because mito not only generates the code, it also annotates the code such that it’s clear to those who’re not familiar with Python or pandas.
The first thing that you can do is to explore your data. Particularly, you can take a quick look at your data column-wise.
As shown in the animated image above, after you select a column, the data explorer is shown. There are three tabs.
Filter/Sort: you can filter your data by specifying a series of criteria, and you can sort the data as needed.
Value: it shows the frequency table, so you can have an idea about what values are available and their frequency.
Summary Stats: the histogram is pretty handy, as it provides an intuitive overview in terms of data distribution. Following that, you’ll see the summary
In the animation, you may notice that we sort the data using the mpg column. This operation resulted in additional lines of code, which accounted for these operations and were added to the cell.
So far, we’ve done several steps in manipulating the dataset. One useful way to know where you’re is to view the steps by clicking the “STEPS” button on the right side. The following diagram will be shown to illustrate the steps.
A useful feature of mito is that you can clear these steps and undo/redo your steps very easily. As you can notice, there are different buttons at the top: UNDO, REDO, and CLEAR. For instance, if you click “CLEAR”, you’ll see that the steps that we’ve done will be removed from the history. You can also delete previous steps separately if you want to just undo several steps.
For many beginners, creating the pivot table isn’t the most straightforward in Pandas, because the parameters aren’t too clear. Fortunately, it appears to be easier with mito — the following screenshot shows you such operation.
As you can see, mito uses different terminologies than pandas. In essence, it uses rows and columns to represent the created pivot table such that you can visualize your pivot table first and then specify the needed data. The following code snippet shows you the corresponding Python code. You can tell that it’s more intuitive with the mito approach.
pivot_table = tmp_df.pivot_table(    index=['model_year'],    columns=['origin'],    values=['mpg'],    aggfunc={'mpg': ['mean']})
You can also intuitively merge DataFrames with mito by clicking the “MERGE” button. In the menu, you can specify what tables you want to merge. The common merge types are supported, as shown in the screenshot below.
After you specify the two tables, you can specify the key upon which they merge. However, I do notice a limitation here, because you can only specify one key for each table. If I’m not mistaken and if you want to use multiple keys, it doesn’t appear to support this feature now.
You can also create graphs using mito, although the supported graphs look limited now.
As you can see, you can only create bar, box, histogram, and scatter with mito for now. One thing that is different from the previous steps is that the code creating the graph isn’t automatically included in the cell. For your convenience, I’ve copied the code for you.
# Import plotly and create a figureimport plotly.graph_objects as gofig = go.Figure()# Add box plots to the graphfor column_header in ['mpg', 'horsepower']:    fig.add_trace(go.Box(y=mpg_csv[column_header], name=column_header))# Update the title and stacking mode of the graph# See Plotly documentation for customizations: https://plotly.com/python/reference/box/fig.update_layout(    title='mpg, horsepower box plot',    barmode='stack')fig.show(renderer="iframe")
As you can see, mito uses the plotly as its drawing backend.
In many situations, we need to repeat our processing steps. Mito made it possible too. You’ll simply save your analysis by clicking “SAVE” button at the top. When you need to re-run the analysis with a different dataset, just click “REPLAY”, where you can start to re-do the analysis.
Besides the above operations, you can also add and remove columns, which should be very straightforward to you without my showing you these operations. That’s pretty much a review of this mito tool.
In my opinion, the mito library seems a growing tool that is still under development. The developers seem diligent and are working on it to make a better tool for those who’re less coding-savvy. With that said, it may be useful for those who are new to Python or Pandas. However, I doubt the long-term use of this tool, because so far, all these operations don’t really require sophisticated coding skills. In other words, mito is trying to address something that isn’t too hard to code so most people can learn to code to solve these issues without the significant time investment.
Relatedly, another thing that the developers of the mito team may consider is that if the users already know to install Python and Jupyter Notebook, they are probably relatively savvy with Python and Pandas programming. With that level of coding skills, they should already be familiar with the operations that mito has to offer at this stage. In other words, the target audience of mito seems unclear.
Nevertheless, I appreciate that the developers have made great efforts to put together this GUI tool to advance the data science field.
Thanks for reading this article. Stay connected by signing up my newsletter. Not a Medium member yet? Support my writing by using my membership link.