Discover a slick way to combine the LINQ OrderBy clause with the .NET random generator to randomize data queries.
- [Instructor] Randomized sampling of data…is important in many scenarios.…For example, in some cases,…it helps cancel the effects of confirmation bias.…It can smooth over unintended patterns…in the data collection.…It's an essential component in most scientific trials.…In this tip, I'll look at how to use the LINQ tools in .NET…to quickly run a randomized query against the data set.…Yes, there are other ways to implement this.…For example, with a specialized shuffle algorithm.…But this example is quick and easy.…
For this example, I'm using a WPF application.…That way, I can show you a simple bar graph…with a randomized data.…I've got three charts in this window.…The top one, the red one, is bound to the data source…and I've done nothing special to it.…It's showing the data…in the order that is coming from the data source.…The orange graph and the blue graph…are both bound to the same underlying data source…as the red graph, but this time,…I'm using the tip to randomize the appearance of the data.…
Every time I click on this Update button,…
Author
Updated
6/18/2018Released
2/27/2017Skill Level Intermediate
Duration
Views
Q: Why can't I earn a Certificate of Completion for this course?
A: We publish a new tutorial or tutorials for this course on a regular basis. We are unable to offer a Certificate of Completion because it is an ever-evolving course that is not designed to be completed. Check back often for new movies.
Related Courses
-
Introduction
-
Use the GitHub Extension1m 39s
-
Tips
-
Brace matching in C#4m 57s
-
Paste JSON/XML as class3m 42s
-
Insert Line with Ctrl Enter2m 21s
-
Use the File Tab channel3m 31s
-
Keyboard access for CodeLens4m 32s
-
Use the Clipboard Ring2m 56s
-
Use DialogResult6m 48s
-
Label a breakpoint2m 31s
-
Use the nameof operator6m 21s
-
Array Visualizer extension2m 35s
-
Toolbox tip shortcuts6m 1s
-
Randomize data with LINQ4m 13s
-
Get the file path1m 25s
-
Convert lists4m 34s
-
Enum flags5m 19s
-
Reference highlighting2m 4s
-
Customize the output window7m 37s
-
Use the C# interactive window10m 47s
-
Reference Highlighting1m 35s
-
- 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.
CancelTake 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.
Share this video
Embed this video
Video: Randomize data with LINQ