-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Give examples using easier libraries such as rows #15
Comments
Thanks for the suggestion; it's something to definitely think about going
|
Adding my input for what I teach journalism students in a quarter-long course: I like to keep things as "plain" as possible. Stick to builtins when possible, e.g. The rows library looks cool, like other nifty data-wrangling wrappers such as pandas, agate, pudo/dataset etc, but novice programmers don't need easier ways to access attributes of a row object. They need affirmation of lists vs. dicts, str vs int, etc. More importantly, they need to know that data is text. And this requires fundamentally understanding what CSV purports to be, and how this relates to the actual realities of computing: computers don't have "intelligence", they need formats to be able to turn text into data structures, and there is a huge difference between a giant string, and that string deserialized as list/dicts. Getting to that concept, and understanding for-loops and iteration, is all I ask of my students for my class. We don't get into making web apps, understanding OOP, doing data analysis or statistics, visualization, etc. -- it's all understanding text, patterns, and loops. This is not just informed from how I've seen programming-learners struggle, but top-flight award-winning investigative journalists not have a clue about that the CSV they open up in Excel is just text. This misunderstanding of something fundamental is not just a non-trivial thing, but it leads to measurable problems when it comes to using that data for investigations. So, this is all a long way of just saying, text, str, dict, list is just fine for students, IMHO :) |
Hello,
I'm working on a library which makes the use of tabular data pretty easy, no matter the format: CSV, XLS, XLSX, HTML etc. It's called rows.
I think it would be great to add a section with examples using this kind of library, since the learner can access data with simple commands and don't need to understand about the format upfront.
An example: reading the CSV file from
coding-for-journalists/2_web_scrape/completed/fun_with_csv_done.py
withrows
is as easy as:If the same was only available on XLS, you could use this code:
So the interface is the same, no matter the format. I think it helps who is learning the basics -- then, they can dig deeper and learn more about each specific format.
The text was updated successfully, but these errors were encountered: