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
نمایش بیشتر📈 تحلیل کانال تلگرام Data Science & Machine Learning
کانال Data Science & Machine Learning (@datasciencefun) در بخش زبانی انگلیسی بازیگری فعال است. در حال حاضر جامعه شامل 77 285 مشترک است و جایگاه 2 004 را در دسته آموزش و رتبه 4 033 را در منطقه الهند دارد.
📊 شاخصهای مخاطب و پویایی
از زمان ایجاد در невідомо، پروژه رشد سریعی داشته و 77 285 مشترک جذب کرده است.
بر اساس آخرین دادهها در تاریخ 27 اوت, 2026، کانال فعالیت پایداری دارد. در ۳۰ روز گذشته تغییر اعضا برابر 372 و در ۲۴ ساعت گذشته برابر 1 بوده و همچنان دسترسی گستردهای حفظ شده است.
- وضعیت تأیید: تأیید نشده
- نرخ تعامل (ER): میانگین تعامل مخاطب 2.60% است و در ۲۴ ساعت نخست پس از انتشار، محتوا معمولاً 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