TGViewer
Data Science & Machine Learning Data Science & Machine Learning @datasciencefun · 77.8K subscribers
Post #3923 4.88K
✅ Python for Data Science: Part-3

NumPy Pandas Basics 📊🐍
These two libraries form the foundation for handling and analyzing data in Python.

1️⃣ NumPy – Numerical Python
NumPy helps with fast numerical operations and array handling.

Importing NumPy
import numpy as np

Create Arrays
arr = np.array([1, 2, 3])
print(arr)

Array Operations
a = np.array([1, 2, 3])
b = np.array([4, 5, 6])
print(a + b) # [5 7 9]
print(a * 2) # [2 4 6]

Useful NumPy Functions
np.mean(a)          # Average
np.max(b) # Max value
np.arange(0, 10, 2) # [0 2 4 6 8]

2️⃣ Pandas – Data Analysis Library
Pandas is used to work with data in table format (DataFrames).

Importing Pandas
import pandas as pd

Create a DataFrame
data = {
"Name": ["Riya", "Aman"],
"Age": [24, 30]
}
df = pd.DataFrame(data)
print(df)

Read CSV File
df = pd.read_csv("data.csv")

Basic DataFrame Operations
df.head()       # First 5 rows  
df.info() # Column types
df.describe() # Stats summary
df["Age"].mean() # Average age

Filter Rows
df[df["Age"] > 25]

🎯 Why This Matters
• NumPy makes math faster and easier
• Pandas helps clean, explore, and transform data
• Essential for real-world data analysis

Practice Task:
• Create a NumPy array of 10 numbers
• Make a Pandas DataFrame with 2 columns (Name, Score)
• Filter all scores above 80

💬 Tap ❤️ for more
  • ❤ 11
  • 👍 2
  • 👏 1
More from @datasciencefun
  1. Oct 17, 2026𝗜𝗕𝗠 𝗙𝗥𝗘𝗘 𝗧𝗘𝗖𝗛 𝗖𝗢𝗨𝗥𝗦𝗘𝗦 𝟮𝟬𝟮𝟲! 🎓 Explore IBM Cognitive Class and build…
  2. Oct 16, 2026𝗗𝗮𝘁𝗮 𝘀𝗰𝗶𝗲𝗻𝗰𝗲 𝗖𝗲𝗿𝘁𝗶𝗳𝗶𝗰𝗮𝘁𝗶𝗼𝗻 𝗪𝗶𝘁𝗵 𝗔𝗜😍 Future Ready Data Scien…
  3. Oct 15, 2026Post #4665
  4. Oct 15, 2026Post #4664
  5. Oct 15, 2026Post #4663
  6. Oct 15, 2026Post #4662
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →