Uploaded January 2019 | Updated November 2026, 3 hours ago
Learn data skills with hands-on exercises & tutorials at Datacamp!
datacamp.pxf.io/c/3588040/1012793/13294
In this video we take the connect 4 game that we built in the How to Program Connect 4 in Python series and add an expert level AI to it. We start out with a very simple implementation of just dropping a piece randomly and then progress to choosing a column based on score and then finally implementing the minimax algorithm with alpha beta pruning.
Here is the link to the code we started with: github.com/KeithGalli/Connect4-Python
To understand the theory behind this code, make sure to watch this video on how a board game AI works: youtu.be/y7AKtWGOPAE
To understand alpha-beta pruning, check out this video: youtu.be/l-hh51ncgDI
To build the game we started out with, watch these four videos:
1. youtu.be/UYgyRArKDEs
2. youtu.be/zD-Xuu_Jpe4
3. youtu.be/SDz3P_Ctm7U
4. youtu.be/krCKxcrHeN4
If you want to send me your finished AI, email me: kgmit18@gmail.com
Follow me on social media too please :)
instagram.com/keithgalli
twitter.com/keithgalli
Thanks for watching! Hope you all learning something
SUBSCRIBE to not miss out on any future videos
---------------------
If you are curious to learn how I make my tutorials, check out this video: youtu.be/LEO4igyXbLs
Join the Python Army to get access to perks!
YouTube - youtube.com/channel/UCq6XkhO5SZ66N04IcPbqNcw/join
Patreon - patreon.com/keithgalli
*I use affiliate links on the products that I recommend. I may earn a purchase commission or a referral bonus from the usage of these links.
Learn data skills with hands-on exercises & tutorials at Datacamp!
datacamp.pxf.io/c/3588040/1012793/13294
In this video we take the connect 4 game that we built in the How to Program Connect 4 in Python series and add an expert level AI to it. We start out with a very simple implementation of just dropping a piece randomly and then progress to choosing a column based on score and then finally implementing the minimax algorithm with alpha beta pruning.
Here is the link to the code we started with: github.com/KeithGalli/Connect4-Python
To understand the theory behind this code, make sure to watch this video on how a board game AI works: youtu.be/y7AKtWGOPAE
To understand alpha-beta pruning, check out this video: youtu.be/l-hh51ncgDI
To build the game we started out with, watch these four videos:
1. youtu.be/UYgyRArKDEs
2. youtu.be/zD-Xuu_Jpe4
3. youtu.be/SDz3P_Ctm7U
4. youtu.be/krCKxcrHeN4
If you want to send me your finished AI, email me: kgmit18@gmail.com
Follow me on social media too please :)
instagram.com/keithgalli
twitter.com/keithgalli
Thanks for watching! Hope you all learning something
SUBSCRIBE to not miss out on any future videos
---------------------
If you are curious to learn how I make my tutorials, check out this video: youtu.be/LEO4igyXbLs
Join the Python Army to get access to perks!
YouTube - youtube.com/channel/UCq6XkhO5SZ66N04IcPbqNcw/join
Patreon - patreon.com/keithgalli
*I use affiliate links on the products that I recommend. I may earn a purchase commission or a referral bonus from the usage of these links.



![Solving 100 Python NumPy Problems! (From easy to difficult)
NumPy is a foundational library for computation in Python. In this video we walk through exercises to learn the library in a hands-on manner. We learn skills such as array creation and manipulation, working with random numbers, performing mathematical operations, handling dates, dealing with various data types, and more. Should be a lot of fun!
Link to GitHub repo: https://github.com/rougier/numpy-100
My solutions: https://github.com/KeithGalli/numpy-100
If you enjoy this video, make sure to throw it a like & subscribe if you havent already 🫡
Here is a link to the similar video I did with the Python Pandas library!
https://youtu.be/i7v2m-ebXB4?si=G3U8SRK2k2mgoQ7e
Video timeline!
0:00 - Video Overview & Code Setup
4:18 - 1.) Import the numpy package under the name np
5:15 - 2.) Print the numpy version and the configuration
6:21 - 3.) Create a null vector of size 10
9:29 - 4.) How to get the memory size of any array
15:19 - 5.) How to get documentation of the numpy add function from the command line
18:51 - 6.) Create a null vector of size 10 but the fifth value which is 1
20:03 - 7.) Create a vector with values ranging from 10 to 49
21:48 - 8.) Reverse a vector (first number becomes last)
23:20 - 9.) Create a 3x3 Matrix with values ranging from 0 to 8
24:41 - 10.) Find indices of non-zero elements from array
26:24 - 11.) Create a 3x3 identity matrix
29:35 - 12.) Create a 3x3x3 array with random values.
30:48 - 13.) Create a 10x10 array with random values and find min/max values
33:17 - 14.) Create a random vector of size 30 and find the mean value
34:57 - 15.) Create a 2d array with 1 on the border and 0 inside
40:19 - 16.) How to add a border (filled with 0’s around an existing array? (np.pad)
43:41 - 17.) Evaluate some np.nan expressions
48:32 - 18.) Create a 5x5 matrix with values 1,2,3,4 just below the diagonal
56:01 - 19.) Create an 8x8 matrix and fill it with a checkerboard pattern
1:02:35 - 20.) Get the 100th element from a (6,7,8) shape array
1:07:09 - 21.) Create a checkerboard pattern 8x8 matrix using np.tile function
1:16:22 - 22.) Normalize a random 5x5 matrix
1:24:20 - 23.) Create a custom dtype that describes a color as four unsigned bytes (RGBA)
1:29:27 - 24.) Multiply a 5x3 matrix by a 3x2 matrix (real matrix product)
1:32:54 - 25.) Given a 1D array, negate all elements which are between 3 and 8, in place
1:37:16 - 26.) Default “range” function vs numpy “range” function
1:40:25 - 27.) Evaluate whether expressions are legal or not
1:55:41 - 28.) Evaluate divide by zero expressions / np.nan type casting
1:57:48 - 29.) How to round away from zero a float array?
1:59:22 - 30.) How to find common values between two arrays?
2:00:19 - 31.) How to ignore all numpy warnings?
2:03:24 - 32.) Is np.sqrt(-1) np.emath.sqrt(-1) ??
2:05:22 - 33.) Get the dates of yesterday, today, and tomorrow with numpy
2:19:39 - 34.) How to get all the dates corresponding to the month of July 2016?
2:27:27 - 35.) How to compute ((A+B)*(-A/2)) in place (without copy)?
2:35:00 - 36.) Extract the integer part of a random array of positive numbers using 4 different methods
2:40:47 - 37.) Create a 5x5 matrix with row values ranging from 0 to 4
2:43:07 - 38.) Use generator function that generates 10 integers and use it to build an array
2:43:58 - 39.) Create a vector of size 10 with values ranging from 0 to 1, both excluded.
2:48:49 - 40.) Create a random vector of size 10 and sort it.
2:51:07 - 41.) How to sum a small array faster than np.sum?
2:54:37 - 42.) Check if two random arrays A & B are equal
2:58:48 - 43.) Make an array immutable (read-only)
3:02:14 - Puppies are great
3:03:06 - 44.) Convert cartesian coordinates to polar coordinates
3:20:37 - 45.) Create a random vector of size 10 and replace the maximum value by 0
3:23:58 - 46.) Create a structured array with x and y coordinates covering the [0,1]x[0,1] area
3:26:25 - 47.) Given two arrays, X and Y, construct the Cauchy matrix C (Cij = 1/(xi-yj))
3:34:31 - 48.) Print the min/max values for each numpy scalar type
3:36:50 - 49.) How to print all the values of an array?
3:39:23 - 50.) How to find the closest value (to a given scalar) in a vector?
I got a little tired at the end, so not doing all 100 problems in this video. Will release the next 50 problems soon!
#python #numpy
Follow me on social media!
Instagram | https://www.instagram.com/keithgalli/
Twitter | https://twitter.com/keithgalli
Learn data skills with hands-on exercises & tutorials at Datacamp!
https://datacamp.pxf.io/c/3588040/1012793/13294
Practice your Python Pandas data science skills with problems on StrataScratch!
https://stratascratch.com/?via=keith
*I use affiliate links on the products that I recommend. I may earn a purchase commission or a referral bonus from the usage of these links. Solving 100 Python NumPy Problems! (From easy to difficult)](https://i.ytimg.com/vi/PM504XhEVCU/mqdefault.jpg)



![Why Should you Learn Python? - Simple Installation & Setup for Windows, Mac, & Linux!
Quick video on why you should learn to program in python followed by setup instructions for a python development environment using python 3 and sublime text 3. Video outline in comments.
Watch on 1.25x or 1.5x speed to learn faster!
Code Snippet for Sublime Text 3 (Mac, Linux):
{
cmd: [python3, -i, -u, $file],
file_regex: ^[ ]File (...?), line ([0-9]*),
selector: source.python
}
I will be posting tutorial videos every week so make sure to SUBSCRIBE to not miss any of those.
If you have any questions leave a comment down below :)
⭐ Kite is a free AI-powered coding assistant that will help you code faster and smarter. The Kite plugin integrates with all the top editors and IDEs to give you smart completions and documentation while you’re typing. Ive been using Kite for 6 months and I love it! https://www.kite.com/get-kite/?utm_medium=referral&utm_source=youtube&utm_campaign=keithgalli&utm_content=description-only
PYTHON TUTORIAL SERIES:
1. Math & Variables: https://youtu.be/XM0CtrJYM2A
2. Conditional Statements (if, elif, else): https://youtu.be/vsVGPcfxEiA
3. Functions: https://youtu.be/5U95tRdYySA
4. Lists & Tuples: https://youtu.be/_zFI6ytHHdY
5. For Loops & While Loops: https://youtu.be/WPF5M_Ic6Fc
Learn to Program a game: https://youtu.be/-8n91btt5d8
Follow me on social media!
Instagram | https://www.instagram.com/keithgalli/
Twitter | https://twitter.com/keithgalli
If you are curious to learn how I make my tutorials, check out this video: https://youtu.be/LEO4igyXbLs
*I use affiliate links on the products that I recommend. I may earn a purchase commission or a referral bonus from the usage of these links. Why Should you Learn Python? - Simple Installation & Setup for Windows, Mac, & Linux!](https://i.ytimg.com/vi/RJL6Y761TNE/mqdefault.jpg)


