A new table: workshop registrations
Check an AI's count of people on a table you have not seen, with different columns and less help.
2 parts · 6 and 4 min
Free course. Your Maestro, an AI, .
A training team asked an AI assistant a straightforward question about their upcoming workshops: "How many people have at least one active registration?" The assistant answered 7 and showed the two lines of Glossary word code it ran to get that number.
Up to now, you have worked with the eight rows of the shop orders table, and each page guided you through one step at a time. Here you meet a table you have not seen before, with 10 rows and four columns: signup, person_email, session, and registration_state. The column names are different, and the AI's filter uses != (not equal to) rather than ==.
This page leaves out the worked examples, the code comments, and the expected answer on purpose. When someone hands you an AI's count at work, you only have the table, the question, and the code. To check the AI's answer of 7 and replace it with a number you can trust, complete four parts in order:
State the grain of the table
Print
datain the exercise below and inspect all four columns (signup,person_email,session, andregistration_state). Write one sentence saying what a single row stands for, and note whether the same person can appear on several rows.Read the AI's code line by line
Explain in plain English what
data["registration_state"] != "cancelled"keeps and drops, and state whatlen(active)actually counts on the filtered table.Repair the count to match the question
Add code that counts what the question asks for, as it is worded.
Check your repaired number a second way
Verify your count independently: print the sorted list of unique
person_emailvalues fromactive, or list the qualifying emails by hand from the printed table, and confirm that the list and your count agree.
Because this page tests whether you can run the whole check on your own, help works differently here. Your Maestro will hold back on hints until you have posted your own attempt at the Glossary word sentence and a repaired count. Asking your Maestro for a hint is always fine, and once you have tried on your own, your Maestro will coach you through whatever is blocking you. Just know how it is recorded: completing the four parts unaided counts as independent evidence of the skill, while finishing with hints from your Maestro counts as help-assisted practice.
Try it
Start in the code box below. Add print(data) at the top to see all 10 rows, then add your repaired count and your second check beneath the AI's lines. If you have tried a repair and your count still disagrees with your list of emails, send your attempt to your Maestro.
A good place to stop. Up next: part 2 of 2 · 4 min
Once your repaired count and your second check agree in the output above, write down your grain sentence and your line-by-line reading in the check below. When all four parts are ready, you can also share your code and output with your Maestro.