AISaturdaysOgbomoso Cohort 2, WEEK1: Introduction to Python for Data Science(numpy)
Good news! we concluded our AISaturday classes for cohort 1 in September and now we have started cohort 2. Cohort 1 was really amazing 😍.
We decided to go back to the basics(Python, Data Science, Machine learning) of Artificial Intelligence itself in cohort 2, we started with a 3-day python class and on the 5th of December 2018, we had our very first class on Data Science starting with the topic: numpy.
We discovered so many things that numpy can do being just a single library. Numpy has the ability to do the following:
. Convert a list into an array: An array can perform the functions of a list but it is rarely used in python. Numpy array is a new python type. Unlike lists, two arrays can divide each other and an array can be divided through by a single number. It is advisable to use arrays instead of lists when performing arithmetic functions and when storing a large amount of data. It must be noted that arrays can only contain a single python type.
. Perform arithmetic functions: Mean, median, standard deviation, dot product , matrix multiplication , square root, cos e.t.c all of these can be calculated using numpy which implies that numpy can also perform the function of a calculator.
. Correlation: Numpy can also be used to find out the correlation between data e.g between columns in a table i.e making comparisons.
. Production of random numbers: Another amazing thing that numpy is able to do is to produce random numbers. Note that if you ask numpy to produce random numbers from different computers, you will have totally different numbers except you do this:
i. import numpy as np
np.random.seed(4)
using this code will help in having universal random numbers, note that the numbers must be the same inside the ‘seed’ bracket.
ii. np.random.rand(3,4): Helps you create random numbers of 3 rows and 4 columns. Note that the number you insert into the bracket depends on the number of rows and columns you intend on creating, the number on the left side of the bracket is for the rows while that on the right side of the bracket is for the columns.
These and so many more are what we learnt about numpy.
Thanks to our ambassador Emmanuel Oludare for writing this and Daniel Ajisafe and Tejumade Afonja for guiding us.
AISaturdayOgbomoso wouldn’t have happened without our fellow ambassadors and coaches, our partners Intel.
follow us on twitter @LautechDataSci