Skip to content

Mission 9: Advanced Editing with Python

Learning Objective

Learn how to manipulate data using Python code snippets generated from natural language prompts.


Knowledge Requirement

Basic knowledge of Python or another programming language is recommended for this mission.


Dataset

Download the required dataset: new_table_cars.xlsx


Step-by-Step Instructions

1. Open Your Dataset

Open the data you want to manipulate.

2. Enter a Natural Language Prompt

In the search bar, write your prompt and press Enter. LOGIBLOX will generate Python code based on your request.

3. View the Generated Python Code

On the left side of the input field, click the pencil icon to open the code snippet. This shows the Python code that has been generated for your prompt.

4. Modify and Execute

Modify the Python code to your requirements and press Run to execute your custom manipulation.


Visual Guide

Generated Python Code

Generated Python Code

Python code generated for the prompt - filters and removes rows where Width is less than 70

Initial Result

First Filter Result

Result after running the code above - all Widths are now greater than 70

Result

Modified Python Code

Modified Python Code

Modified Python snippet with an additional filter to keep rows only if Length is smaller than 190 - dataset reduced to three rows

Benefits of Python Manipulation

  • Full Control - Write any Python code for complex transformations
  • Flexibility - Use pandas, numpy, and other libraries
  • Learning - See how natural language converts to Python
  • Reusability - Save and reuse code snippets across datasets

Summary

You've successfully learned how to:

✓ Generate Python code from natural language prompts

✓ View and understand the generated Python code

✓ Modify Python code for advanced data manipulation

✓ Execute custom Python transformations on your data

✓ Combine multiple filters and operations


Well done! Now let's move on to the next mission!