Prompts for Python Coding
What are we asking the AI Assistant to help us with? Option / Example
Help fix a coding error, and provide options Run code in Notebook
to run or copy the code provided by the AI. Debug the active
code cell Copy
Solve a specific programming problem: “Create a function that takes a list object as
task it with a clear and concise challenge a parameter and that counts the number of
values in it that are smaller than 20.”
Rename object names in code “Rename function to ‘count’.”
(provided by either you or the AI)
Address multiple modifications with a single request “Change the iterator variable name to
x and the ‘count’ variable to ‘total’.”
Modify a function you have already created “Create a function that has the same purpose and
instead of starting from scratch structure, but that uses a ‘while’ instead of a ‘for’ loop?”
Understand a given piece of code Explain the selected code
Run code in Notebook
Add comments to a given piece of code, with options Add comments to
to run, apply, or copy the code received from the AI the selected code Replace Selection
Copy
Streamline code by removing unnecessary
components and receiving suggestions for Refactor the selected code
alternative tools to enhance performance
Clean a dataset you have uploaded (e.g. the lending
company data uploaded from a *.csv file into a “Clean the df_lending_company dataset.”
DataFrame named df_lending_company)
C reate a visual representation of two columns from “Plot the ‘AmtPaid60’ against the ‘Deposit’ for all records
your dataset (e.g. "AmtPaid60" and "Deposit") while containing no missing values in the relevant two columns.”
in the data analysis stage