
Unlocking Data Science: How Gemini Pro and Llama Index Will Transform Your Workflow
Last Updated on September 17, 2024 by Editorial Team
Author(s): Neil Patel
Originally published on Towards AI.
This member-only story is on us. Upgrade to access all of Medium.
In this article, I will demonstrate how prompt engineering can be used to generate and execute pandas code, enabling quick and efficient data analysis. Weβll cover the key steps a data scientist typically follows:
1. Data Exploration2. Data Visualization3. Data Cleaning 4. Model Creation & Evaluation
To demonstrate these capabilities, Iβll be using the American Express Default Prediction dataset from Kaggle. Below is how we acquire the data:
!kaggle competitions download -c amex-default-prediction## Unzip the filezip_file_path = 'amex-default-prediction.zip'with zipfile.ZipFile(zip_file_path, 'r') as zip_ref: zip_ref.extractall()## List the extracted filesextracted_files = zip_ref.namelist()
In our prompt, we aim to extract key insights from the DataFrame by addressing three specific questions:
DataFrame Shape: Assess the size and structure of the DataFrame.Column Optimization: Identify and drop columns with excessive null values to streamline the dataset.Dependent Variable Analysis: Determine the unique values in the dependent variable and their frequencies.
In this step, we visually explore the data by generating bar graphs:
Top 10 Columns with Missing Data: A bar graph highlights columns with the most missing values, quickly revealing potential data quality issues.
Join thousands of data leaders on the AI newsletter. Join over 80,000 subscribers and keep up to date with the latest developments in AI. From research to projects and ideas. If you are building an AI startup, an AI-related product, or a service, we invite you to consider becoming aΒ sponsor.
Published via Towards AI