Data Science & Machine Learning
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
Ko'proq ko'rsatish📈 Telegram kanali Data Science & Machine Learning analitikasi
Data Science & Machine Learning (@datasciencefun) Ingliz til segmentidagi kanali faol ishtirokchi. Hozirda hamjamiyat 77 329 obunachidan iborat bo'lib, Taʼlim toifasida 1 996-o'rinni va Hindiston mintaqasida 3 959-o'rinni egallagan.
📊 Auditoriya ko‘rsatkichlari va dinamika
невідомо sanasidan buyon loyiha tez o‘sib, 77 329 obunachiga ega bo‘ldi.
30 Avgust, 2026 dagi oxirgi ma’lumotlarga ko‘ra kanal barqaror faollikka ega. Oxirgi 30 kunda obunachilar soni 354 ga, so‘nggi 24 soatda esa 45 ga o‘zgardi va umumiy qamrov yuqori darajada qolmoqda.
- Tasdiqlash holati: Tasdiqlanmagan
- Jalb etish (ER): Auditoriya o‘rtacha 2.69% darajada jalb etiladi. Nashrdan keyingi dastlabki 24 soatda kontent odatda umumiy obunachilar sonining 1.10% ini tashkil etuvchi reaksiyalarni to‘playdi.
- Post qamrovi: Har bir post o‘rtacha 2 081 marta ko‘riladi; birinchi sutkada odatda 847 ta ko‘rish yig‘iladi.
- Reaksiyalar va o‘zaro ta’sir: Auditoriya faol: har bir postga o‘rtacha 4 ta reaksiya keladi.
- Tematik yo‘nalishlar: Kontent learning, accuracy, distribution, panda, dataset kabi asosiy mavzularga jamlangan.
📝 Tavsif va kontent siyosati
Muallif resursni shaxsiy fikrni ifoda etish maydoni sifatida ta’riflaydi:
“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”
Yuqori yangilanish chastotasi (oxirgi ma’lumot 31 Avgust, 2026 da olingan) sababli kanal doimo dolzarb va katta qamrovli bo‘lib qoladi. Analitika auditoriya kontent bilan faol hamkorlik qilishini, uni Taʼlim toifasidagi muhim ta’sir nuqtasiga aylantirishini ko‘rsatadi.
new_list = [expression for item in iterable]
🔹 2. Creating a List Using a Loop
numbers = []
for i in range(5):
numbers.append(i)
print(numbers)
Output
[0, 1, 2, 3, 4]
🔹 3. Creating the Same List Using List Comprehension
numbers = [i for i in range(5)]
print(numbers)
Output
[0, 1, 2, 3, 4]
Notice how the code is shorter and easier to read.
🔹 4. Performing Calculations
Create a list of squares.
squares = [x ** 2 for x in range(1, 6)]
print(squares)
Output
[1, 4, 9, 16, 25]
🔹 5. Using Conditions
You can filter elements while creating a list.
Example: Even Numbers
even_numbers = [x for x in range(1, 11) if x % 2 == 0]
print(even_numbers)
Output
[2, 4, 6, 8, 10]
🔹 6. Converting Strings
Convert all names to uppercase.
names = ["rahul", "deepak", "anita"]
upper_names = [name.upper() for name in names]
print(upper_names)
Output
['RAHUL', 'DEEPAK', 'ANITA']
🔹 7. Using Conditional Expressions
Replace negative numbers with zero.
numbers = [5, -2, 8, -1, 3]
updated = [0 if x < 0 else x for x in numbers]
print(updated)
Output
[5, 0, 8, 0, 3]
🔹 8. Nested List Comprehension
Create a multiplication table.
table = [[i * j for j in range(1, 6)] for i in range(1, 4)]
print(table)
Output
[[1, 2, 3, 4, 5],
[2, 4, 6, 8, 10],
[3, 6, 9, 12, 15]]
🔹 9. Real-World Data Science Example
Suppose you have a list of sales amounts.
sales = [1200, 850, 1500, 600, 2000]
high_sales = [sale for sale in sales if sale > 1000]
print(high_sales)
Output
[1200, 1500, 2000]
This technique is commonly used while cleaning and filtering datasets before analysis.
🔹 10. Benefits of List Comprehensions
✅ Shorter code
✅ Easier to read
✅ Faster than traditional loops in many cases
✅ Widely used in Data Science and Machine Learning
🔹 11. Common Mistakes
❌ Forgetting the Expression
numbers = [for i in range(5)] # SyntaxError
Correct:
numbers = [i for i in range(5)]
❌ Incorrect Order of "if"
numbers = [if x % 2 == 0 x for x in range(10)] # SyntaxError
Correct:
numbers = [x for x in range(10) if x % 2 == 0]student = {
"name": "Rahul",
"age": 23
}
print(student.keys())
print(student.values())
print(student.items())
🔹 8. Real-World Data Science Example
Suppose you have student information.
students = [
{"name": "Amit", "marks": 90},
{"name": "Sara", "marks": 85}
]
for student in students:
print(student["name"], student["marks"])
Output
Amit 90
Sara 85
This is very similar to how records are stored before converting them into a Pandas DataFrame.
🔹 9. Common Mistakes
❌ Trying to Modify a Tuple
colors = ("Red", "Green")
colors[0] = "Blue"
This raises a TypeError because tuples are immutable.
❌ Accessing a Missing Dictionary Key
student = {"name": "John"}
print(student["age"])
This raises a KeyError.
A safer approach:
print(student.get("age"))
🎯 Practice Questions
1. Create a list of five cities and print the third city.
2. Create a tuple containing the days of the week.
3. Remove duplicate numbers from a list using a set.
4. Create a dictionary containing your name, age, and profession.
5. Print all keys and values of a dictionary using a loop.
🎯 Key Takeaways
✅ Lists are ordered and mutable.
✅ Tuples are ordered and immutable.
✅ Sets store only unique values.
✅ Dictionaries store data as key-value pairs.
✅ Dictionaries and Lists are the most commonly used data structures in Data Science.
Mastering these four data structures will make it much easier to work with datasets, APIs, JSON files, and machine learning projects.
Double Tap ❤️ For Part-8
-----
1.28 ₽ · /balance_helpfruits = ["Apple", "Banana", "Mango"]
print(fruits)
Output
['Apple', 'Banana', 'Mango']
Accessing Elements
print(fruits[0])
print(fruits[2])
Output
Apple
Mango
Modifying a List
fruits[1] = "Orange"
print(fruits)
Output
['Apple', 'Orange', 'Mango']
Adding Elements
fruits.append("Grapes")
print(fruits)
Removing Elements
fruits.remove("Orange")
print(fruits)
🔹 2. Tuple
A Tuple is an ordered collection that cannot be modified after creation (immutable).
Creating a Tuple
colors = ("Red", "Green", "Blue")
print(colors)
Accessing Elements
print(colors[1])
Output
Green
Why Use Tuples?
Use tuples when your data should never change.
Examples:
• Months of the year
• Days of the week
• Fixed coordinates
🔹 3. Set
A Set is an unordered collection of unique elements.
Duplicate values are automatically removed.
Creating a Set
numbers = {1, 2, 2, 3, 4, 4, 5}
print(numbers)
Output
{1, 2, 3, 4, 5}
Adding Elements
numbers.add(6)
Removing Elements
numbers.remove(3)
Common Uses
• Remove duplicates
• Membership testing
• Mathematical set operations
🔹 4. Dictionary ⭐
A Dictionary stores data as key-value pairs.
It is one of the most frequently used data structures in Data Science.
Creating a Dictionary
student = {
"name": "Deepak",
"age": 24,
"course": "Data Science"
}
print(student)
Accessing Values
print(student["name"])
Output
Deepak
Adding a New Key
student["city"] = "Mumbai"
Updating a Value
student["age"] = 25
Removing a Key
del student["course"]
🔹 5. Comparison of Data Structures
Feature | List | Tuple | Set | Dictionary
Ordered | ✅ | ✅ | ❌ | ✅
Mutable | ✅ | ❌ | ✅ | ✅
Duplicates Allowed | ✅ | ✅ | ❌ | Keys ❌
Indexed | ✅ | ✅ | ❌ | By Key
🔹 6. Common List Methods
numbers = [10, 20, 30]
numbers.append(40)
numbers.insert(1, 15)
numbers.remove(20)
numbers.sort()
print(numbers)
🔹 7. Common Dictionary Methods