Join Todd McLeod for an in-depth discussion in this video Calculating median, part of Code Clinic: Go.
- All right.…So, now we're going to calculate our median.…And I've included in here in the read me…a little reminder of how do you calculate the median.…So, if we have an odd number of values,…the median is the value right there in the middle.…And if we have an even number of values,…there is no value right in the middle.…So, we take the two values on each side of the middle.…Right there.…The two middle values.…And we add them together, and then divide by two.…That's how we calculate the median.…So, we need to figure out, do we have an odd number…or an even number of values in the data we're working with?…So, let me show you how I did that.…
I created a new function called median.…And that function, just like my mean function,…the median function is going to take in…a multidimensional slice.…So, once again, this is all of my records.…And here is one record.…Each record is a slice a fields.…And then it also takes in the index position…of the data I want to access in that slice of fields.…So, the first thing I do is I create a slice of Float64.…
Todd introduces challenges and then provides overviews of his solutions in Go. Challenges include topics such as statistical analysis, searching directories for images, and accessing peripheral devices.
Skill Level Beginner
1. Problem 1—Exploring Lake Pend Oreille
2. Problem 2—Image Analysis
3. Problem 3—Eight Queens
4. Problem 4—Accessing Peripherals
5. Problem 5—Recursion and Directories
6. Problem 6—Building the Web
- 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.