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
Показати більше📈 Аналітичний огляд Telegram-каналу Data Science & Machine Learning
Канал Data Science & Machine Learning (@datasciencefun) у мовному сегменті Англійська є активним учасником. На даний момент спільнота об'єднує 77 285 підписників, посідаючи 2 004 місце в категорії Освіта та 4 033 місце у регіоні Індія.
📊 Показники аудиторії та динаміка
З моменту свого створення невідомо, проект продемонстрував стрімке зростання, зібравши аудиторію у 77 285 підписників.
За останніми даними від 27 серпня, 2026, канал демонструє стабільну активність. Хоча за останні 30 днів спостерігається зміна кількості учасників на 372, а за останні 24 години на 1, загальне охоплення залишається високим.
- Статус верифікації: Не верифікований
- Рівень залученості (ER): Середній показник залученості аудиторії становить 2.60%. Протягом перших 24 годин після публікації контент зазвичай збирає 1.12% реакцій від загальної кількості підписників.
- Охоплення публікацій: В середньому кожен допис отримує 2 009 переглядів. Протягом першої доби публікація в середньому набирає 866 переглядів.
- Реакції та взаємодія: Аудиторія активно підтримує контент: середня кількість реакцій на один пост – 3.
- Тематичні інтереси: Контент зосереджений навколо ключових тем, таких як learning, accuracy, distribution, panda, dataset.
📝 Опис та контентна політика
Автор описує ресурс як майданчик для висловлення суб'єктивної думки:
“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”
Завдяки високій частоті оновлень (останні дані отримано 28 серпня, 2026), канал підтримує актуальність та високий рівень охоплення публікацій. Аналітика показує, що аудиторія активно взаємодіє з контентом, що робить його важливою точкою впливу в категорії Освіта.
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 Methodsdef greet():
print("Welcome to Data Science!")
greet()
Output
Welcome to Data Science!🔹 2. Why Do We Use Functions? Functions help you: ✅ Avoid writing duplicate code ✅ Improve code readability ✅ Make debugging easier ✅ Reuse code in multiple places ✅ Build modular applications 🔹 3. Defining a Function Syntax
def function_name():
# Function body
Example:
def welcome():
print("Hello, World!")
welcome()
🔹 4. Function Parameters
Parameters allow you to pass information into a function.
def greet(name):
print("Hello", name)
greet("Deepak")
Output
Hello DeepakHere, "name" is called a parameter. 🔹 5. Function Arguments When calling a function, the values you pass are called arguments.
def square(number):
print(number * number)
square(5)
Output
25Here: • "number" → Parameter • "5" → Argument 🔹 6. Returning Values A function can return a value using the return keyword.
def add(a, b):
return a + b
result = add(10, 20)
print(result)
Output
30Using return allows the function's result to be stored or used later. 🔹 7. Default Parameters You can assign default values to parameters.
def greet(name="Guest"):
print("Hello", name)
greet()
greet("Rahul")
Output
Hello Guest Hello Rahul🔹 8. Multiple Return Values A function can return more than one value.
def calculate(a, b):
return a + b, a * b
sum_value, product = calculate(4, 5)
print(sum_value)
print(product)
Output
9 20🔹 9. Scope of Variables Variables created inside a function are called local variables.
def demo():
message = "Inside Function"
print(message)
demo()
Trying to access
messageoutside the function will produce an error because it exists only inside the function. 🔹 10. Built-in Functions Python provides many ready-to-use functions. Examples:
numbers = [5, 2, 8, 1]
print(len(numbers))
print(max(numbers))
print(min(numbers))
print(sum(numbers))
Output
4 8 1 16🔹 11. Real-World Data Science Example Calculate the average marks of students.
def average(marks):
return sum(marks) / len(marks)
scores = [80, 75, 92, 88]
print(average(scores))
Output
83.75Functions like this are commonly used while cleaning data, calculating statistics, and building machine learning pipelines. 🔹 12. Common Mistakes ❌ Forgetting to Call the Function
def greet():
print("Hello")
# Nothing happens because the function isn't called.
Correct:
greet()
❌ Forgetting to Return a Value
def add(a, b):
a + b
# Correct:
def add(a, b):
return a + b
🎯 Practice Questions
1. Write a function to add two numbers.
2. Create a function to calculate the square of a number.
3. Write a function that checks whether a number is even or odd.
4. Create a function to calculate the average of a list.
5. Write a function that returns the largest of three numbers.
Double Tap ❤️ For Part-7