Programmers hate code written for a specific case, "I don't careif it can solve one special case, I want it tosolve all cases." This generalization process iscalled "abstraction".
Being able to convert in only one direction is only helpful halfthe time. Specious math aside,
Write a generalized JSON->CSV converter function.
Use the two function you just created, demonstrate a"round-trip" (CSV->JSON->CSV or JSON->CSV->JSON)for thefollowing dataset.
Dataset: Consumer Complaint Database datafoundat https://catalog.data.gov/dataset/consum ... navigation
Now compare the original file and the round-trip files. Theseshould be reasonably identical.
What do I mean by reasonably identical? You might run into someinstances where the various packages encapsulate text in quotes.Minor issues like this are okay, but you need to explain why theyare specifically occurring, if you decide not to clean themup.If you wish to resolve this issue, You could:Look at the various parameters to resolve this issueRun the round trip twice. Then you would be make your output filefrom the first run your input file for the second run. Not ideal,but it works.
Programmers hate code written for a specific case, "I don't care if it can solve one special case, I want it to solve al
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am