text stringlengths 1 81 | start float64 0 10.1k | duration float64 0 24.9 |
|---|---|---|
all of those but absolutely you could | 1,001.519 | 3.76 |
skew things though hopefully if you're | 1,003.44 | 3.36 |
implementing a gambling game or the like | 1,005.279 | 3.12 |
you're not actually making some cards | 1,006.8 | 3.92 |
more probable than others | 1,008.399 | 4.481 |
allow me to turn back now to our | 1,010.72 | 4.16 |
implementation here of this randomness | 1,012.88 | 3.92 |
and consider how we might leverage other | 1,014.88 | 3.44 |
types of functionality that aren't | 1,016.8 | 3.76 |
necessarily in this specific library | 1,018.32 | 4.4 |
here well it turns out that python also | 1,020.56 | 4.239 |
comes with a statistics library and this | 1,022.72 | 3.68 |
contains all sorts of functions for | 1,024.799 | 3.921 |
doing things more statistical in nature | 1,026.4 | 4.96 |
namely calculating means or medians or | 1,028.72 | 4.479 |
modes or other | 1,031.36 | 3.599 |
aspects of a data set that you might | 1,033.199 | 4.24 |
want to analyze so how might we use the | 1,034.959 | 4.321 |
statistics module on python well we | 1,037.439 | 2.961 |
might first just take a look at its | 1,039.28 | 3.36 |
documentation like any other module in | 1,040.4 | 4.08 |
python and we'll see within that library | 1,042.64 | 3.52 |
that there's a whole bunch of functions | 1,044.48 | 3.359 |
and one of those functions is one that's | 1,046.16 | 3.68 |
quite simple it's average a function | 1,047.839 | 4.08 |
that allows you to calculate the average | 1,049.84 | 4.16 |
of some numbers that you've passed in | 1,051.919 | 3.76 |
let me go ahead and envious code in my | 1,054 | 3.84 |
terminal window open up a new file | 1,055.679 | 4.721 |
called average.pi and at the top of this | 1,057.84 | 4.32 |
file i'm going to import a different | 1,060.4 | 4.24 |
library this time namely the statistics | 1,062.16 | 4.8 |
module in python and now i'm going to go | 1,064.64 | 4.08 |
ahead and call a function that i know | 1,066.96 | 4.88 |
comes in that module namely mean for the | 1,068.72 | 4.64 |
average of some values and i'm going to | 1,071.84 | 3.68 |
call statistics.mean | 1,073.36 | 4.96 |
and i'm going to pass into this function | 1,075.52 | 4.72 |
mean a list of some values and let's | 1,078.32 | 3.28 |
suppose that i'm quickly trying to | 1,080.24 | 3.6 |
calculate what my current grade average | 1,081.6 | 4.24 |
is in school and i did really well on my | 1,083.84 | 3.839 |
first test and i got a hundred percent | 1,085.84 | 3.68 |
and on my second i did well but not as | 1,087.679 | 4.161 |
well and i got a 90. and ironically i'm | 1,089.52 | 3.84 |
not very good with math so i'd like to | 1,091.84 | 3.28 |
figure out what my average now is | 1,093.36 | 3.439 |
between those two tests so let me go | 1,095.12 | 3.6 |
ahead now and in this list type in the | 1,096.799 | 5.201 |
number 100 comma 90 thereby passing in a | 1,098.72 | 6.88 |
list of two values two ants 190 and ins | 1,102 | 5.2 |
outside of those are the parentheses | 1,105.6 | 3.04 |
because of course this is now the | 1,107.2 | 3.04 |
argument i'm passing to the function | 1,108.64 | 4.24 |
called mean and this function mean is in | 1,110.24 | 5.439 |
the module called statistics well it's | 1,112.88 | 4.48 |
not that interesting to just calculate | 1,115.679 | 3.36 |
the mean if i don't actually see what it | 1,117.36 | 3.52 |
is so let me additionally pass the | 1,119.039 | 4.241 |
return value of that mean function to | 1,120.88 | 4.72 |
the print function as usual let me now | 1,123.28 | 4.48 |
in my terminal window in vs code type in | 1,125.6 | 4.56 |
python of average.pi and hit enter and | 1,127.76 | 4.96 |
voila as you might expect my average is | 1,130.16 | 3.759 |
95 | 1,132.72 | 2.56 |
so the difference here is that i'm just | 1,133.919 | 2.961 |
using a different module that still | 1,135.28 | 3.519 |
comes with python but i need to import | 1,136.88 | 4.32 |
it instead of for instance the random | 1,138.799 | 4.321 |
module instead and this time i know from | 1,141.2 | 3.44 |
the documentation that there exists a | 1,143.12 | 4.16 |
function called mean well it turns out | 1,144.64 | 4.72 |
there's even more functionality that | 1,147.28 | 4.08 |
comes with python and that comes with | 1,149.36 | 2.8 |
other | 1,151.36 | 2.48 |
modules in python and there's this | 1,152.16 | 3.6 |
feature generally known as command line | 1,153.84 | 3.68 |
arguments this is a feature not just of | 1,155.76 | 4 |
python but of languages more generally | 1,157.52 | 4.88 |
that allow you to provide input not when | 1,159.76 | 5.44 |
prompted inside of a program as happens | 1,162.4 | 5.279 |
whenever we call the python function | 1,165.2 | 4.96 |
input but rather there's this feature | 1,167.679 | 4.321 |
command line arguments of programs that | 1,170.16 | 4 |
allows you to provide arguments that is | 1,172 | 4.08 |
input to the program | 1,174.16 | 3.519 |
just when you're executing it at the | 1,176.08 | 3.28 |
command line so up until now for | 1,177.679 | 3.36 |
instance recall that we've generally run | 1,179.36 | 3.84 |
python of something dot pi for instance | 1,181.039 | 4.961 |
python of hello dot pi and i've never | 1,183.2 | 5.2 |
once really executed any words or | 1,186 | 5.52 |
phrases after the name of the file but i | 1,188.4 | 5.68 |
could in fact when you're running | 1,191.52 | 4.8 |
programs in a command like environment | 1,194.08 | 4.4 |
like we are you can provide any number | 1,196.32 | 5.52 |
of words or numbers or phrases after the | 1,198.48 | 4.88 |
command that you're typing and all of | 1,201.84 | 3.6 |
those will somehow be passed in as | 1,203.36 | 4.64 |
inputs to the program itself you don't | 1,205.44 | 5.599 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.