Python 3, pytube 9.0.6 in Windows 10.
pytube is a very easy to use, light-weight library that you can sue to download YouTube Videos.
Installation can be achieved in the terminal or command prompt with pip:
To download a video from YouTube you don’t really have to do much. So much so that you can get everything you need from the shell and be downloading a video in two lines of code.
>>> from pytube import YouTube
In line 2 you can see that we have copied and pasted our YouTube url. You can either use the one in the Address Bar on the one that appears when you click “Share” on YouTube.
Continue reading “How do I download YouTube videos with Python 3 using Pytube?”
The Standard RANDBETWEEN
We can achieve a random range of numbers in Google Sheets by using the RANDBETWEEN formula. The formula is quite simple to use. Just add your start range and your end range:
=RANDBETWEEN(start range, end range)
For example, if I want to get a random number between zero(o) and 60 I would do the following:
The result will provide a whole random number somewhere between these two and including these numbers.
If I were to repeat this formula over a reasonable sample, say 300 times, we should see a fairly even spread of numbers occurring a roughly the same frequency, just like in the graph below:
But what if we wanted to have fewer random numbers in our list at the lower or upper end or on both ends?
Continue reading “Skewed Random Range in Google Sheets (RANDBETWEEN)”
Random Combinations Without Repetition Using Arrays, TRANSPOSE and Randomize Ranges
Say you have a list of 30 people and a 30 list of groups. After every half hour for six hours the people must change to another group, but they cannot go back to a group they have already been in.
How can we schedule 12 sessions where every person can randomly go to another group without going to the same group twice?
This is pretty much the same issue I face when scheduling my teachers to proctor exams randomly each quarter for different classes. The rules I need to follow are:
- No teacher should proctor the same class twice.
- Assignment to proctor a class should seem random.
- The teacher that teaches the class cannot proctor their own class.
- Each week has an exam over the term. The term runs for 8 weeks plus a final requiring a total of 9 proctor sessions.
Continue reading “How do I Randomly Assign People to a Group Without Doubling Up on the Same Group in Google Sheets”