Skip to content

Latest commit

 

History

History
100 lines (74 loc) · 2.65 KB

File metadata and controls

100 lines (74 loc) · 2.65 KB

Getting Started with Kaggle and Google Colab

This guide walks you through setting up your Kaggle account, accessing Google Colab, and running your first test lab.

1. Create a Kaggle Account

  1. Go to https://www.kaggle.com
  2. Click “Sign Up” in the top-right corner.
  3. Choose one of the following sign-up options:
    • Sign up with Google (recommended)
    • Sign up with Email
  4. Verify your email address if prompted.
  5. Once logged in:
    • Go to your Profile → fill in your name and details.
    • (Optional) Enable 2-step verification for security.
  6. You can now explore datasets:

2. Set Up Google Colab

  1. Visit https://colab.research.google.com
  2. Log in using your Google account.
  3. You’ll see a welcome screen — click:
    • “New Notebook” to start a new Python notebook.
  4. Rename your notebook:
    • Click on the notebook title (Untitled.ipynb) → give it a name, e.g., MyFirstColab.ipynb.

3. Test Lab: Using Google Colab

Try the following steps to understand the basics:

Step 1: Run a Python Cell

Type this in a code cell:

print("Hello, Google Colab!")

Then press Shift + Enter or click the ▶️ Run button.

You should see:

Hello, Google Colab!

Step 2: Check Python Version

!python --version

Step 3: Install a Package

Example: Install numpy and test it.

!pip install numpy
import numpy as np
arr = np.array([1, 2, 3])
print("Numpy array:", arr)

Step 4: Mount Google Drive (Optional)

To access your Google Drive files:

from google.colab import drive
drive.mount('/content/drive')

Follow the link shown → authorize → copy & paste the code back into Colab.

Step 5: Simple Data Visualization

import matplotlib.pyplot as plt

x = [1, 2, 3, 4, 5]
y = [n**2 for n in x]

plt.plot(x, y, marker='o')
plt.title("Simple Plot in Colab")
plt.xlabel("X")
plt.ylabel("Y^2")
plt.show()

4. Save and Share Your Notebook

  • To save your work: → Go to File → Save a copy in Drive

  • To share your notebook: → Click Share (top-right) → choose visibility (e.g., “Anyone with the link”)

5. Next Steps