Week 7 - BALT 4396B - Chapter 8-10

 Learning Python with ChatGPT and Google Colab

Chapter 8-9 Summary


Chapter 8 of Professor Kelsey's book "Learning Python with ChatGPT and Google Colab" goes over Python Libraries. We got a very quick summary of what Python libraries are in one of the past weeks as an introduction to Python. To quickly summarize it again Python libraries are collections of codes that can be used and copied onto your own work. These codes that are found in the libraries can help you save a lot of time. You won't have to always put effort into creating new codes if you find what you need within these libraries. This can be seen as a very useful feature. 

This chapter also covers how Python libraries and Google Colab are linked to each other. Let's take a quick look at how to use these libraries with Google Colab.
Step 1 - Open a new or existing notebook in Google Colab.
Step 2 - use the !pip install command followed by the name of the library (to install a library) 
Ex: !pip install numpy
Step 3- After installation you are able to import the library. You will have to use the import statement in the same code cell/ cell subsequent cell. 
Ex: import numpy as np
Step 4 - Once library is imported it is ready to be used on your notebook.

Chapter 9 is similar to chapter 8. It's a refresher of NumPy. This is another feature we have already been introduced to, but this chapter explains how to use with Google Colab. Here's a quick refresher on NumPy. NumPy is similar to a library with codes expect NumPy is more of a library for arrays and matrices. You can do the same with these array/matrices as the codes. Copy them and run them on your own work. 
Here is how to use NumPy with Google Colab.
Step 1 - Open Google Colab https://colab.research.google.com/
Step 2 - Click file top left corner and then click "New Notebook"
Step 3 - Cope paste code cell into separate cells in notebook.
Step 4 - Run each cell by clicking the play button or you can hit Shift + Enter on our keyboard.

 



Comments