Artificial Intelligence LAB
Lab-03 (07-10-2025)
Student Name: ______________________Roll No________________
All tasks are mapped to CLO1
Task 1: Setting Up Google Colab
1. Go to Google Colab.
2. Sign in with your Google account.
3. Create a new notebook and rename it to Lab_Tasks_YourName.
4. Add a text cell with the title: "Introduction to Google Colab".
5. Write a brief description of Google Colab and its features in the text cell.
6. Add a code cell and print "Hello, Google Colab!".
Task 2: Importing Data from Kaggle
1. Install the Kaggle API:
!pip install kaggle
2. Upload your Kaggle API key ([Link]) to Colab:
from [Link] import files
[Link]()
3. Set up the Kaggle API:
!mkdir ~/.kaggle
!cp [Link] ~/.kaggle/
!chmod 600 ~/.kaggle/[Link]
4. Browse Kaggle Datasets and choose any dataset of your choice.
5. Download the dataset using the Kaggle API command:
!kaggle datasets download -d username/dataset-name
6. Unzip the dataset:
!unzip [Link]
7. Load the dataset into a Pandas DataFrame and display the first 5 rows.
Task 3: Importing Data from a URL
1. Use a dataset URL (e.g., from GitHub or any public data source).
2. Load the dataset into a Pandas DataFrame:
import pandas as pd
url = "[Link]
data = pd.read_csv(url)
3. Display the first 10 rows of the dataset.
4. Print the summary statistics of the dataset using the describe() method.
Task 4: Importing Data from Local Hard Disk
1. Download a dataset (e.g., a CSV file) to your local machine.
2. Upload the dataset to Google Colab:
from [Link] import files
uploaded = [Link]()
3. Load the uploaded dataset into a Pandas DataFrame:
import io
data = pd.read_csv([Link](uploaded['[Link]']))
4. Display the first 5 rows of the dataset.
5. Plot a histogram of one of the numerical columns using matplotlib.
Task 5: Basic Data Analysis
1. Use the dataset you downloaded from Kaggle (Task 2).
2. Display the first 5 rows of the dataset.
3. Check for missing values in the dataset using the isnull() method.
4. Fill missing values in one of the columns with the mean or median.
5. Plot a bar chart showing the distribution of a categorical column.
6. Plot a histogram of a numerical column.
Task 6: Saving and Sharing Your Work
1. Save your notebook to Google Drive:
o Click on File > Save a copy in Drive.
2. Download the notebook to your local machine:
o Click on File > Download .ipynb.
3. Share your notebook with a classmate:
o Click on the Share button and adjust the sharing settings.