0
0
Data Analysis Pythondata~10 mins

Google Colab as alternative in Data Analysis Python - Step-by-Step Execution

Choose your learning style9 modes available
Concept Flow - Google Colab as alternative
Open Browser
Go to colab.research.google.com
Create New Notebook
Write Python Code
Run Code in Cloud
View Output & Save to Drive
This flow shows how you open Google Colab, create a notebook, write and run Python code in the cloud, then view and save your results.
Execution Sample
Data Analysis Python
import pandas as pd

data = {'Name': ['Anna', 'Ben'], 'Age': [28, 34]}
df = pd.DataFrame(data)
df.head()
This code creates a small table with names and ages, then shows the first rows.
Execution Table
StepActionCode LineResult/Output
1Import pandas libraryimport pandas as pdpandas module loaded
2Create data dictionarydata = {'Name': ['Anna', 'Ben'], 'Age': [28, 34]}{'Name': ['Anna', 'Ben'], 'Age': [28, 34]}
3Create DataFrame from datadf = pd.DataFrame(data)DataFrame with 2 rows and 2 columns created
4Display first rowsdf.head() Name Age 0 Anna 28 1 Ben 34
💡 Code execution ends after displaying the DataFrame head.
Variable Tracker
VariableStartAfter Step 2After Step 3After Step 4
dataundefined{'Name': ['Anna', 'Ben'], 'Age': [28, 34]}{'Name': ['Anna', 'Ben'], 'Age': [28, 34]}{'Name': ['Anna', 'Ben'], 'Age': [28, 34]}
dfundefinedundefinedDataFrame with 2 rows and 2 columnsSame DataFrame displayed
Key Moments - 2 Insights
Why do we not see any output after importing pandas?
Importing a library loads it but does not produce visible output, as shown in step 1 of the execution_table.
What does df.head() show and why?
df.head() shows the first few rows of the DataFrame to give a quick look at the data, as seen in step 4.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table at step 3, what is the value of variable df?
AA dictionary with names and ages
BA DataFrame with 2 rows and 2 columns
CUndefined
DA list of names
💡 Hint
Check the 'Result/Output' column at step 3 in execution_table.
At which step does the code display the data table output?
AStep 4
BStep 1
CStep 3
DStep 2
💡 Hint
Look for the step where df.head() is called in execution_table.
If we remove the line 'import pandas as pd', what will happen at step 3?
ADataFrame will be created successfully
BData dictionary will be printed
CError because pandas is not defined
DNothing will happen
💡 Hint
Without importing pandas, pd.DataFrame cannot be used as shown in variable_tracker.
Concept Snapshot
Google Colab lets you write and run Python code in your browser.
You create notebooks online without installing anything.
Code runs on Google's cloud servers.
You can save and share notebooks easily.
Great for data analysis and learning Python.
Full Transcript
Google Colab is an online tool where you can write and run Python code without installing software. You open your browser, go to colab.research.google.com, and create a new notebook. Then you write Python code, like importing pandas and creating a table. When you run the code, it executes on Google's servers and shows the output below the code. This way, you can do data analysis easily and save your work to Google Drive.