In this article we review last week's Analyse NBA Data with SQL/sqlite3 code challenge.
Check out our solution for this challenge.
cursor.executemanyto bulk insert records.
We were using
cursor.fetchallbut to get one record/row you can use
Simple SQLite arithmetic (
games/active AS games_per_year)
Probably don't need
CASTif you add types to DB columns (looking at other PRs!)
Check out solutions PR'd by our community.
Some learnings taken from these Pull Requests:
Refreshed SQL. Learned about sqlite command line. Learned PyCharm DataSource integration and querying. Refreshed git commands.
I used this challenge as a chance to experiment with Jupyter notebook to help visualize the data
Read Code for Fun and Profit
Other learnings we spotted in Pull Requests week: itertools, difflib / similarity measures, collections, pytest and patch.
Thanks to everyone for your participation in our blog code challenges!
Need more Python Practice?
Subscribe to our blog (sidebar) to get a new PyBites Code Challenge (PCC) in your inbox each Monday.
And/or take any of our 50+ challenges on our platform.
Prefer coding self contained exercises in the comfort of your browser? Try our growing collection of Bites of Py.
Keep Calm and Code in Python!
-- Bob and Julian
See an error in this post? Please submit a pull request on Github.