# Core Concepts

### The mito spreadsheet in a notebook

Mito is a spreadsheet that exists inside of a Jupyter Notebook, and helps you do Python data analytics. You can use Mito to explore and edit data like you would in Excel or Python.

<figure><img src="https://2294704369-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MP_U5ZCmiamDOXEOOTC%2Fuploads%2FZ6RGIfxUL8qDuTfBE4zu%2FScreen%20Shot%202023-11-29%20at%2012.31.27%20PM.png?alt=media&#x26;token=37cbe10e-1d43-44eb-9ff3-fce39eca62c5" alt=""><figcaption><p>A Mito spreadsheet inside of a JupyterLab notebook.</p></figcaption></figure>

### Pandas dataframes and the Mito Spreadsheet

Pandas is the most popular data analysis and manipulation tool in Python. It is based around the core concept of a "dataframe," which is a rectangular table of data with columns and rows.

Normally, you would write pandas code directly to manipulate your data, but by using Mito, you can explore and manipulate your dataframes in the mitosheet, directly within your notebook. Every tab inside of your Mitosheet represents a different Pandas dataframe.

Click the `Add Column` button in Mito? A column gets added to your dataframe. Pivot your data to create aggregate statistics? A new, tab with an aggregated dataframe is created.

### Generating Pandas Code

For each edit you make to the Mitosheet, Mito generates pandas code below that corresponds to this edit, and puts this code directly below the mitosheet in the next code cell.

<figure><img src="https://2294704369-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MP_U5ZCmiamDOXEOOTC%2Fuploads%2FEsDqsmxthnDwcNUJjvPt%2FScreen%20Shot%202023-11-29%20at%2012.31.59%20PM.png?alt=media&#x26;token=38ce732b-0bb0-4612-bb22-41573b29ecba" alt=""><figcaption><p>Code generated by Mito: importing a CSV file and adding a column.</p></figcaption></figure>

### Rerunning an analysis

When you run `mitosheet.sheet()`, Mito will automatically generate a unique ID to store the set of edits make to this mitosheet. This ID will appear as an automatically generated `analysis_to_replay` parameter to the `mitosheet.sheet()` function call.

As long as you pass this `analysis_to_replay` parameter to the `mitosheet.sheet()` call, Mito will attempt to replay that analysis to the mitosheet. Replaying an analysis means applying the same edits that you did in Mito again.&#x20;

Since Mito will try and apply the same edits when an `analysis_to_replay` parameter is passed, *differently structured datasets* might make these edits invalid and Mito will error. For example, if you change the location of the file that you imported in an analysis, and then attempt to replay this analysis, it will fail (as it can no longer find the file to import).

If you want to start a fresh mitosheet, simply make a new `mitosheet.sheet()` call in a new code cell.
