TDM 10100: Project 2 — Fall 2026
-
Responsible Usage of Generative AI in Projects
-
Documenting, Disclosing, and Academic Integrity in Reporting and Publishing
-
Best Practices for Teamwork and Collaboration on Data-Driven Projects
Motivation: In Project 2, we will work with a teammate and with Generative AI to get comfortable with analyzing data in The Data Mine.
Context: We will work with data that is likely too large for your Generative AI tools to handle. We want you to (please) limit yourself to a free (no-cost) tools, for this project.
Scope: Anvil, Generative AI, Python
Dataset(s)
This project will use the following dataset:
-
/anvil/projects/tdm/data/consumer_complaints/complaints.csv
|
In this project, please only use 2 cores in your Jupyter Lab session: (do not use 4 cores or 16 cores for this project) Please also thoroughly document who you work with, and how you use Generative AI in this project. |
Questions
Question 1 (2 pts)
The Consumer Financial Protection Bureau provides data about consumer complaints here:
specifically, from the link that says "Download all complaint data (CSV ZIP)"
BUT you do not need to download this data. It is already available for you on Anvil, at the location:
/anvil/projects/tdm/data/consumer_complaints/complaints.csv
which is ready for you in Anvil.
This is a large file, and we do not want you to create a data frame with the entire data.
We also want you to tell the Generative AI that the first line of the file is a header row. We also want you to tell the Generative AI that some of the fields might have newline characters within the data itself, so it may help to use a csv.reader.
Hint: There should be 17433612 complaint records, plus 1 header row. If you use a csv.reader, you should only need a small number of lines of Python to verify this. You do not need more than (say) 10 lines of Python in your answer!
Find a teammate, and ask 2 or 3 different Generative AI tools (please use the no-cost, free versions) how you can use Python to find the number of records in the complaints.csv file without reading the file into a data frame, and also how to identify how large the file is. (Be sure to indicate if your size is given in bytes, gigabytes, etc.)
|
Please do not read the data into a data frame in this project. |
Note the similarities and differences found in the various Generative AI methods. Document which teammate(s) that you worked with, and how you used the Generative AI tools.
Give complete sentences in English that demonstrate that you understand how the Python works. Do not copy-and-paste your sentences of explanations from Generative AI. Also, each student should write their own explanations.
-
How many records are in the
complaints.csvfile altogether? (There should be 17433612 records, plus 1 header row. If you get 28222810 or 28222826 records, you forgot to tell Python that some of your text fields have newline characters.) -
How large is the
complaints.csvfile? -
Be sure to document your work from Question 1, using some comments and insights about your work.
Question 2 (2 pts)
Next, use Python to look at the first row of the file, so that you know what the variables are called.
Again with a teammate, ask 2 or 3 different Generative AI tools (please use the no-cost, free versions) how you can use Python to extract only the records from complaints.csv corresponding to the state of Indiana. Save these records into a data frame. Make one data frame for each Generative AI tool that you use. For instance, you might have a GeminiIndiana data frame that Gemini help you to build, containing only the records corresponding to the state of Indiana. You might also have an OpenAIIndiana data frame for Indiana, and also a ClaudeIndiana data frame for Indiana.
Within each of the Indiana data frames that you created, find the top 5 zip codes (from Indiana), according to the number of complaints.
Now discuss the results with your teammate, and compare the results from the various Generative AI tools. How are the results similar or different?
If you get a result like "464XX", that is OK!
-
Show the head of each of your Indiana-only data frames from each of the Generative AI tools.
-
Discuss the similarities and differences of the methods and the results from the Generative AI tools that you tried.
-
Identify the top 5 zip codes (from Indiana), according to the number of complaints.
-
Be sure to document your work from Question 2, using some comments and insights about your work.
Question 3 (2 pts)
Returning to the complaints from the full data set (not only from Indiana):
Again, without reading the data frame into memory (because it is too large), ask 2 or 3 Generative AI tools how to find the top 5 states, according to the number of complaints. Similarly, ask 2 or 3 Generative AI tools how to find the top 5 zip codes (from the whole country, not just from Indiana), according to the number of complaints.
It is OK if one of the zip codes shows "XXXXX".
Now discuss the results with your teammate, and compare the results from the various Generative AI tools. How are the results similar or different?
Finally, make a bar plot that shows the top 5 states, according to the number of complaints.
-
Find the top 5 states, according to the number of complaints.
-
Find the top 5 zip codes (from the whole country, not just from Indiana), according to the number of complaints.
-
Make a bar plot that shows the top 5 states, according to the number of complaints.
-
Be sure to document your work from Question 3, using some comments and insights about your work.
Question 4 (2 pts)
Working in a similar way to the questions above:
From the 2nd column, make a bar plot that shows the number of complaints, according to the type of Product involved.
Now make another bar plot from the second column, showing the number of complaints, according to the type of Product involved, but this time remove the lines with Product:
Credit reporting or other personal consumer reports
(The second question is given because there are so many of these complaints that it is hard to see the rest of the types of Products, in comparison.)
Now do a similar analysis of the 12 column, namely:
Make a bar plot of the responses in the 12th column, about how the number of complaints, according to how the response was submitted.
Because Web is the most common reply in the 12th column, make another bar plot of the responses in the 12th column, about how the number of complaints, according to how the response was submitted, but this time remove the Web responses first.
-
Make a bar plot in Python that shows the number of complaints, according to the type of Product involved
-
Make this bar plot again, but this time without the
Credit reporting or other personal consumer reportsresponses. -
Make a bar plot that shows the number of complaints, according to how the response was submitted.
-
Make this bar plot again, but this time without the
Webresponses. -
Be sure to document your work from Question 4, using some comments and insights about your work.
Question 5 (2 pts)
In the 8th column, what are the top 5 companies that appear?
The 11th column has Tags that are often blank, but when they are present, what are the values that appear there, and how many times does each value appear?
Make a bar plot of the responses in the 14th column, about the number of complaints, according to the Company response to consumer.
In the 15th column, what percentage of complaints had a timely response?
-
What are the top 5 companies that appear?
-
What are the values that appear as Tags, and how many times does each value appear?
-
Make a bar plot of the number of complaints, according to the
Company response to consumer. -
What percentage of complaints had a timely response?
-
Be sure to document your work from Question 5, using some comments and insights about your work.
Submitting your Work
Please make sure that you added comments for each question, which explain your thinking about your method of solving each question. Please also make sure that your work is your own work, and that any outside sources (people, internet pages, generative AI, etc.) are cited properly in the project template.
Prior to submitting your work, you need to put your work into the project template, and re-run all of the code in Jupyter Lab and make sure that the results of running that code is visible in your template. Please check the detailed instructions on how to ensure that your submission is formatted correctly. To download your completed project, you can right-click on the file in the file explorer and click 'download'.
Once you upload your submission to Gradescope, make sure that everything appears as you would expect to ensure that you don’t lose any points. We hope your first project with us went well, and we look forward to continuing to learn with you on future projects!!
-
firstname_lastname_project2.ipynb
|
It is necessary to document your work, with comments about each solution. All of your work needs to be your own work, with citations to any source that you used. Please make sure that your work is your own work, and that any outside sources (people, internet pages, generative AI, etc.) are cited properly in the project template. You must double check your Please take the time to double check your work. See here for instructions on how to double check this. You will not receive full credit if your |