Data Science & Machine Learning
73.8K subscribers
816 photos
2 videos
68 files
714 links
Join this channel to learn data science, artificial intelligence and machine learning with funny quizzes, interesting projects and amazing resources for free

For collaborations: @love_data
Download Telegram
Which keyword is used to check multiple conditions?
Anonymous Quiz
14%
A) elseif
60%
B) elif
22%
C) else if
4%
D) multiple
โค3
๐Ÿ”น Q4. What will be the output?

x = 7 if x > 10: print("A") elif x > 5: print("B") else: print("C")
Anonymous Quiz
13%
A
77%
B
9%
C
1%
D
โค2
What will be the output?

age = 16 print("Adult") if age >= 18 else print("Minor")
Anonymous Quiz
24%
Adult
76%
Minor
โค5๐Ÿ˜1
๐Ÿš€๐—š๐—ฒ๐˜ ๐—ง๐—ผ๐—ฝ ๐—–๐—ฒ๐—ฟ๐˜๐—ถ๐—ณ๐—ถ๐—ฐ๐—ฎ๐˜๐—ถ๐—ผ๐—ป๐˜€ ๐—œ๐—œ๐—ง's & ๐—œ๐—œ๐—  

Dreaming of studying at an IIT and building a career in AI ? This is your chance

โœ… Prestigious IIT  Certification
โœ… Learn directly from IIT Professors
โœ… Placement Assistance with 5000+ Companies

๐Ÿ’ก Todayโ€™s top companies are actively looking for professionals with AI skills. 

๐—ฅ๐—ฒ๐—ด๐—ถ๐˜€๐˜๐—ฒ๐—ฟ ๐—ก๐—ผ๐˜„ ๐Ÿ‘‡ :- 

๐—”๐—œ & ๐——๐—ฎ๐˜๐—ฎ ๐—ฆ๐—ฐ๐—ถ๐—ฒ๐—ป๐—ฐ๐—ฒ :- https://pdlink.in/4kucM7E

๐—”๐—œ & ๐— ๐—ฎ๐—ฐ๐—ต๐—ถ๐—ป๐—ฒ ๐—Ÿ๐—ฒ๐—ฎ๐—ฟ๐—ป๐—ถ๐—ป๐—ด :- https://pdlink.in/4rMivIA

๐——๐—ฎ๐˜๐—ฎ ๐—”๐—ป๐—ฎ๐—น๐˜†๐˜๐—ถ๐—ฐ๐˜€ ๐—ช๐—ถ๐˜๐—ต ๐—”๐—œ :- https://pdlink.in/4ay4wPG

โณ Limited seats โ€“ Register before the link expires!
โค2
Now, let's move to the next topic of Data Science Roadmap:

โœ… Python Dictionaries ๐Ÿ“š

Dictionaries are one of the most important data structures in Python, especially in data science and real-world datasets. They store data in keyโ€“value pairs.

๐Ÿ”น 1. What is a Dictionary?
A dictionary stores data in key:value format.

โœ… Example:

student = { "name": "Rahul", "age": 22, "course": "Data Science" }
print(student)


Output: {'name': 'Rahul', 'age': 22, 'course': 'Data Science'}

โœ” Uses curly brackets {}

๐Ÿ”น 2. Access Dictionary Values

Use the key to access values.

student = { "name": "Rahul", "age": 22 }
print(student["name"])


Output: Rahul

๐Ÿ”น 3. Add New Elements

student = { "name": "Rahul", "age": 22 }
student["city"] = "Delhi"
print(student)


Output: {'name': 'Rahul', 'age': 22, 'city': 'Delhi'}

๐Ÿ”น 4. Modify Values

student["age"] = 23


๐Ÿ”น 5. Remove Elements

student.pop("age")


๐Ÿ”น 6. Important Dictionary Methods
โญ

โœ… Get Method:
print(student.get("name"))


Output: Rahul

โœ… Keys Method:
print(student.keys())


Output: dict_keys(['name', 'age'])

โœ… Values Method:
print(student.values())


Output: dict_values(['Rahul', 22])

โœ… Items Method:
print(student.items())


Output: dict_items([('name', 'Rahul'), ('age', 22)])

๐Ÿ”น 7. Loop Through Dictionary

student = { "name": "Rahul", "age": 22 }

for key, value in student.items():
print(key, value)


Output:
name Rahul
age 22

๐ŸŽฏ Todayโ€™s Goal
โœ” Understand keyโ€“value pairs
โœ” Access dictionary values
โœ” Add or update data
โœ” Loop through dictionary

๐Ÿ‘‰ Dictionaries are widely used in APIs, JSON data, and machine learning datasets.

Double Tap โ™ฅ๏ธ For More
โค15๐Ÿฅฐ1
Which symbol is used to create a dictionary in Python?
Anonymous Quiz
18%
A) []
8%
B) ()
71%
C) {}
3%
D) <>
โค1
What will be the output?

student = { "name": "Rahul", "age": 22 } print(student["name"])
Anonymous Quiz
82%
A) Rahul
8%
B) name
3%
C) 22
7%
D) Error
โค1
Which method returns all keys of a dictionary?
Anonymous Quiz
12%
A) values()
12%
B) items()
64%
C) keys()
12%
D) get()
โค1
What will be the output?

data = {"a":1, "b":2} data["c"] = 3 print(data)
Anonymous Quiz
9%
A) {'a':1, 'b':2}
66%
B) {'a':1, 'b':2, 'c':3}
18%
C) Error
7%
D) {'c':3}
โค1
Which method is used to remove an element from a dictionary?
Anonymous Quiz
43%
A) remove()
16%
B) delete()
36%
C) pop()
5%
D) clearitem()
โค7
Data Science Roadmap

โœ… Python File Handling

๐Ÿ๐Ÿ“‚ File handling allows Python programs to read and write data from files.

๐Ÿ‘‰ Very important in data science because most datasets come as:
โœ” CSV files
โœ” Text files
โœ” Logs
โœ” JSON files

๐Ÿ”น 1. Opening a File
Python uses the open() function.
Syntax: open("filename", "mode")
Example: file = open("data.txt", "r")
๐Ÿ‘‰ "r" โ†’ Read mode

๐Ÿ”น 2. File Modes
- "r" โ†’ Read file
- "w" โ†’ Write file (overwrites existing content)
- "a" โ†’ Append file (adds to existing content)
- "r+" โ†’ Read and write

๐Ÿ”น 3. Reading a File
- Read Entire File: file.read()
- Read One Line: file.readline()
- Read All Lines: file.readlines()

๐Ÿ”น 4. Writing to a File
file = open("data.txt", "w")
file.write("Hello Data Science")
file.close()

โš  "w" will overwrite existing content.

๐Ÿ”น 5. Append to File
file = open("data.txt", "a")
file.write("\nNew line added")
file.close()

โœ” Adds content without deleting old data.

๐Ÿ”น 6. Best Practice (Very Important โญ)
Use with statement.
with open("data.txt", "r") as file:
content = file.read()
print(content)

โœ” Automatically closes the file.

๐Ÿ”น 7. Why File Handling is Important?
Used for:
โœ” Reading datasets
โœ” Saving results
โœ” Logging machine learning models
โœ” Data preprocessing

๐ŸŽฏ Todayโ€™s Goal
โœ” Understand file modes
โœ” Read files
โœ” Write files
โœ” Use with open()

๐Ÿ‘‰ File handling is used heavily when working with CSV datasets in data science.

Double Tap โ™ฅ๏ธ For More
โค10
Which function is used to open a file in Python?
Anonymous Quiz
8%
A) file()
62%
B) open()
21%
C) read()
10%
D) openfile()
โค2
Which mode is used to read a file?
Anonymous Quiz
5%
A) "w"
3%
B) "a"
87%
C) "r"
5%
D) "rw"
โค2
What will the following code do?

file = open("data.txt", "w") file.write("Hello")
Anonymous Quiz
5%
A) Reads file
2%
B) Deletes file
89%
C) Writes text to file
4%
D) Prints file content
โค1
Which method reads the entire file content?
Anonymous Quiz
10%
A) readline()
28%
B) readlines()
59%
C) read()
3%
D) get()
โค1
โค2๐Ÿ‘1๐Ÿฅฐ1
Top Programming Languages for Beginners ๐Ÿ‘†
โค4๐Ÿ‘1
โœ… Python Exception Handling (tryโ€“except) ๐Ÿโš ๏ธ

Exception handling helps programs handle errors gracefully instead of crashing.

๐Ÿ‘‰ Very important in real-world applications and data processing.

๐Ÿ”น 1. What is an Exception?

An exception is an error that occurs during program execution.

Example:
print(10 / 0)

Output: ZeroDivisionError

This will crash the program.

๐Ÿ”น 2. Using tryโ€“except

We use tryโ€“except to handle errors.

Syntax:
try:
# code that may cause error
except:
# code to handle error

Example:
try:
x = 10 / 0
except:
print("Error occurred")

Output: Error occurred

๐Ÿ”น 3. Handling Specific Exceptions

try:
num = int("abc")
except ValueError:
print("Invalid number")

โœ” Handles only ValueError.

๐Ÿ”น 4. Using else

else runs if no error occurs.

try:
x = 10 / 2
except:
print("Error")
else:
print("No error")

Output: No error

๐Ÿ”น 5. Using finally

finally always executes.

try:
file = open("data.txt")
except:
print("File not found")
finally:
print("Execution completed")


๐Ÿ”น 6. Common Python Exceptions

โ€ข ZeroDivisionError: Division by zero
โ€ข ValueError: Invalid value
โ€ข TypeError: Wrong data type
โ€ข FileNotFoundError: File does not exist

๐ŸŽฏ Today's Goal

โœ” Understand exceptions
โœ” Use tryโ€“except
โœ” Handle specific errors
โœ” Use else and finally

๐Ÿ‘‰ Exception handling is widely used in data pipelines and production code.

Double Tap โ™ฅ๏ธ For More
โค8
SQL, or Structured Query Language, is a domain-specific language used to manage and manipulate relational databases. Here's a brief A-Z overview by @sqlanalyst

A - Aggregate Functions: Functions like COUNT, SUM, AVG, MIN, and MAX used to perform operations on data in a database.

B - BETWEEN: A SQL operator used to filter results within a specific range.

C - CREATE TABLE: SQL statement for creating a new table in a database.

D - DELETE: SQL statement used to delete records from a table.

E - EXISTS: SQL operator used in a subquery to test if a specified condition exists.

F - FOREIGN KEY: A field in a database table that is a primary key in another table, establishing a link between the two tables.

G - GROUP BY: SQL clause used to group rows that have the same values in specified columns.

H - HAVING: SQL clause used in combination with GROUP BY to filter the results.

I - INNER JOIN: SQL clause used to combine rows from two or more tables based on a related column between them.

J - JOIN: Combines rows from two or more tables based on a related column.

K - KEY: A field or set of fields in a database table that uniquely identifies each record.

L - LIKE: SQL operator used in a WHERE clause to search for a specified pattern in a column.

M - MODIFY: SQL command used to modify an existing database table.

N - NULL: Represents missing or undefined data in a database.

O - ORDER BY: SQL clause used to sort the result set in ascending or descending order.

P - PRIMARY KEY: A field in a table that uniquely identifies each record in that table.

Q - QUERY: A request for data from a database using SQL.

R - ROLLBACK: SQL command used to undo transactions that have not been saved to the database.

S - SELECT: SQL statement used to query the database and retrieve data.

T - TRUNCATE: SQL command used to delete all records from a table without logging individual row deletions.

U - UPDATE: SQL statement used to modify the existing records in a table.

V - VIEW: A virtual table based on the result of a SELECT query.

W - WHERE: SQL clause used to filter the results of a query based on a specified condition.

X - (E)XISTS: Used in conjunction with SELECT to test the existence of rows returned by a subquery.

Z - ZERO: Represents the absence of a value in numeric fields or the initial state of boolean fields.
โค12๐Ÿ˜1
โœ… NumPy Basics ๐Ÿ๐Ÿ“Š

NumPy (Numerical Python) is the most important library for numerical computing in Python.

It is widely used in:
โœ” Data Science
โœ” Machine Learning
โœ” AI
โœ” Scientific computing

๐Ÿ”น 1. What is NumPy?

NumPy provides a powerful data structure called NumPy Array. It is faster and more efficient than Python lists for mathematical operations.

Example:
import numpy as np


๐Ÿ”น 2. Creating a NumPy Array

From a List

import numpy as np
arr = np.array([1, 2, 3, 4])
print(arr)


Output:
[1 2 3 4]


๐Ÿ”น 3. Check Array Type

print(type(arr))


Output:
<class 'numpy.ndarray'>


๐Ÿ”น 4. NumPy Array Operations

Addition:

import numpy as np
arr = np.array([1, 2, 3])
print(arr + 2)


Output:
[3 4 5]


Multiplication:
print(arr * 2)


Output:
[2 4 6]


๐Ÿ”น 5. NumPy Built-in Functions

arr = np.array([10, 20, 30, 40])
print(arr.sum())
print(arr.mean())
print(arr.max())
print(arr.min())


Output:
100
25.0
40
10


๐Ÿ”น 6. NumPy Array Shape

arr = np.array([[1, 2, 3], [4, 5, 6]])
print(arr.shape)


Output:
(2, 3)


Meaning: 2 rows and 3 columns.

๐Ÿ”น 7. Why NumPy is Important?

NumPy is the foundation of data science libraries:
โœ” Pandas
โœ” Scikit-Learn
โœ” TensorFlow
โœ” PyTorch

All these libraries use NumPy internally.

๐ŸŽฏ Today's Goal
โœ” Install NumPy
โœ” Create arrays
โœ” Perform math operations
โœ” Understand array shape

Double Tap โ™ฅ๏ธ For More
โค10๐Ÿ‘2
๐—™๐—ฟ๐—ฒ๐˜€๐—ต๐—ฒ๐—ฟ๐˜€ ๐—–๐—ฎ๐—ป ๐—š๐—ฒ๐˜ ๐—ฎ ๐Ÿฏ๐Ÿฌ ๐—Ÿ๐—ฃ๐—” ๐—๐—ผ๐—ฏ ๐—ข๐—ณ๐—ณ๐—ฒ๐—ฟ ๐˜„๐—ถ๐˜๐—ต ๐—”๐—œ & ๐——๐—ฆ ๐—–๐—ฒ๐—ฟ๐˜๐—ถ๐—ณ๐—ถ๐—ฐ๐—ฎ๐˜๐—ถ๐—ผ๐—ป๐Ÿ˜

IIT Roorkee offering AI & Data Science Certification Program

๐Ÿ’ซLearn from IIT ROORKEE Professors
โœ… Students & Fresher can apply
๐ŸŽ“ IIT Certification Program
๐Ÿ’ผ 5000+ Companies Placement Support

Deadline: 22nd March 2026

๐Ÿ“Œ ๐—ฅ๐—ฒ๐—ด๐—ถ๐˜€๐˜๐—ฒ๐—ฟ ๐—ก๐—ผ๐˜„ ๐Ÿ‘‡ :-

https://pdlink.in/4kucM7E

Big Opportunity, Do join asap!
โค3