Programmer's Treasure Repository : GitHub - Jackpopc/CS-Books-Store: The classic computer books you want are all here!
Hello everyone, my name is Jackpop.
First a question: why did you learn Python?
There is no doubt that Python is one of the hottest programming languages in recent years.
People in different fields and majors are learning Python. Some of them want to engage in development work, but there are also many students who hope to use Python to improve office efficiency and use Python to replace repetitive manual work in daily work. Obviously, the cost of learning Python from beginning to end is very high.
In this post, I will teach you how to automatically generate Python code for spreadsheet manipulation.
Many times we perform operations in MS Excel (spreadsheet). And for each edit operation, if we want to generate the corresponding Python code. Obviously, this is very valuable for students with zero foundation in Python.
Myth
To implement the functions described above, a tool called Mito is required.
Mito is an open, free Python tool that helps newbies to embed MS excel into Jupyter notebooks.
Anything you do on the spreadsheet, Mito will generate the Python code for you in the next cell. You can get Python code even if you don't know Python programming.
To do this, first, you need to install the Mito tool in your Jupyter environment. But before installing Mito, make sure you have Python 3.6 or above.
configure
First, check to see if your Python version is 3.6 and above:
> python — version
If the Python version meets the requirements, next open a new terminal or command prompt and install Mito:
> python -m pip install mitoinstaller
Next, run the installer, which is essential:
> python -m mitoinstaller install
After running, the command line displays the following:
Starting install... Create mito user Upgrading mitoinstaller Checking dependencies Installing mitosheet3 Create import mito startup file Creating a Mitosheet starter notebook Start JupyterLab Finish Installation ---------------------------------------------------------------------------- Mito has finished installing Please shut down the currently running JupyterLab and relaunch it to enable Mito Then render a mitosheet following the instructions here: https://docs.trymito.io/how-to/creating-a-mitosheet ----------------------------------------------------------------------------
This completes the installation.
use
After completing the installation, open it next jupyterlab
, enter the following 2 lines of code, and the execution will open the Mito interface:
import mitosheet mitosheet.sheet()
Click on the menu bar IMPORT
to import spreadsheets in the current directory, or upload files to import:
Then, you can perform different operations on the table, such as merge, delete, filter, add, sort.... Mito will automatically generate the corresponding code for each operation:
import pandas as pd Airport_Pets_csv = pd.read_csv(r'Airport-Pets.csv') # Imported Airport-Pets.csv import pandas as pd Airport_Pets_csv_1 = pd.read_csv(r'Airport-Pets.csv') # Filtered Pets in Airport_Pets_csv Airport_Pets_csv = Airport_Pets_csv[Airport_Pets_csv['Pets'].str.contains('N', na=False)] # Deleted column Food from Airport_Pets_csv Airport_Pets_csv.drop(['Food'], axis=1, inplace=True) # Merged Airport_Pets_csv and Airport_Pets_csv_1 temp_df = Airport_Pets_csv_1.drop_duplicates(subset='Zip') # Remove duplicates so lookup merge only returns
In addition to these basic operations, Mito can also perform pivot tables , formulas , etc., which are often used in data analysis, and are more advanced.
If your work process often involves the processing and analysis of spreadsheets, you can try Mito to automate repetitive manual work, save time and energy, and then you can fish happily~
Hello everyone, I'm Jackpop! I spent half a month putting together various technical dry goods collected in the past few years, including but not limited to Python, machine learning, deep learning, computer vision, recommendation system, Linux, engineering, Java, content Up to 5T+, acquisition method: technical dry goods _ free high-speed download | Baidu network disk - unlimited sharing (extraction code: 0000)