Module 1 Cheatsheet: Data Science and
Generative AI
Popular GenAI tools
Name of model Usage
Data Robot A simple tool useful for data analysis and model building operations
[Link] Synthetic data generation
ChatGPT GPT based model used for text and code generation based on natural language queries
DB Sensei Generate SQL queries for databases using natural language queries
Important prompts for data preparation
Task Prompt
Write a Python code that can perform the following tasks:
Read a CSV data file and load it to a
Read the CSV file, located on a given file path, into a Pandas data frame,
data frame.
assuming that the first rows of the file are the headers for the data.
Data cleaning: Identify and replace
missing values per the following
Write a Python to perform the following tasks:
guidelines.
1. Identify the attributes with missing values.
1. You replace the missing entries in
2. Segregate these attributes into categorical and continuous valued
columns containing categorical values
attributes.
with the most frequent entries
3. Drop the entire row if the value is missing in the target variable.
2. You replace the missing entries in
4. If the value is missing in a categorical attribute, replace the missing
columns with continuous data with the
values with the most frequent value in the column.
mean value of the column.
5. If the value is missing in a continuous value attribute, replace the
3. If a value is missing in the target
missing values with the mean value of the entries in the column.
column, you may need to drop that
row
Write a Python code to normalize the content under a given attribute in a
Data Normalization: Normalize an
data frame df to its maximum value. Make changes to the original data,
attribute to its maximum value.
and do not create a new attribute.
Write a Python code to perform the following tasks.
1. Convert a data frame df attribute into indicator variables, saved as df1,
Converting categorical variable into
with the naming convention "Name_<unique value of the attribute>".
indicator variables
2. Append df1 into the original data frame df.
3. Drop the original attribute from the data frame df.