Join Mark Niemann-Ross for an in-depth discussion in this video Calculations with SQLite and Python, part of Database Clinic: SQLite.
- [Instructor] Now that all the data is imported…into the database,…we can calculate the accident severity…for each type of motorcycle.…There is one catch.…SQLite doesn't have a function to calculate median,…at least not as part of the standard package.…I'll show how to use Python to install that function.…This is all contained in a Python script…in your exercise files.…So I've already started Python Idle.…I'm going to go to Python, File, Open,…and navigate to the Exercise Files folder,…Chapter 3,…and open 4_calculate_median,…and hit Open.…
This is the script that will do the calculations for us.…I'm going to run that script,…and then we'll come back and talk about…how that script actually works.…So to run this script,…I go to Run, Run Module,…and it calculates the severity for each type of motorcycle.…Now you'll notice I've done a little bit more.…We have one column that identifies the type of motorcycle.…The second column is the median severity,…and the third column is the average severity.…
So in case you wanted to know the median or the average,…
- Strengths and weaknesses of SQLite
- Creating a database
- Joining data sets
- Calculations with SQLite and Python
- Searching a database
- Subqueries and queries in SQLite
- CRUD operations in SQLite with R
Skill Level Intermediate
1. SQLite in Five Minutes
2. Create a Database
3. Join Two Datasets
4. Search a Database
5. Create, Read, Update, and Delete Operations
6. Averages and Calculations
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.