Machine Learning
40K subscribers
3.6K photos
28 videos
47 files
623 links
Real Machine Learning β€” simple, practical, and built on experience.
Learn step by step with clear explanations and working code.

Admin: @HusseinSheikho || @Hussein_Sheikho
Download Telegram
from SQL to pandas.pdf
1.3 MB
🐼 "Comparison Between SQL and pandas" – A Handy Reference Guide

⚑️ As a data scientist, I often found myself switching back and forth between SQL and pandas during technical interviews. I was confident answering questions in SQL but sometimes struggled to translate the same logic into pandas – and vice versa.

πŸ”Έ To bridge this gap, I created a concise booklet in the form of a comparison table. It maps SQL queries directly to their equivalent pandas implementations, making it easy to understand and switch between both tools.

⚑ This reference guide has become an essential part of my interview prep. Before any interview, I quickly review it to ensure I’m ready to tackle data manipulation tasks using either SQL or pandas, depending on what’s required.

πŸ“• Whether you're preparing for interviews or just want to solidify your understanding of both tools, this comparison guide is a great way to stay sharp and efficient.

#DataScience #SQL #pandas #InterviewPrep #Python #DataAnalysis #CareerGrowth #TechTips #Analytics

βœ‰οΈ Our Telegram channels: https://xn--r1a.website/addlist/0f6vfFbEMdAwODBk

πŸ“± Our WhatsApp channel: https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘7❀3πŸ”₯1
Numpy from basics to advanced.pdf
2.4 MB
πŸ“• Mastering NumPy – From Basics to Advanced

NumPy is an essential library in the world of data science, widely recognized for its efficiency in numerical computations and data manipulation. This powerful tool simplifies complex operations with arrays, offering a faster and cleaner alternative to traditional Python lists and loops.

The "Mastering NumPy" booklet provides a comprehensive walkthroughβ€”from array creation and indexing to mathematical/statistical operations and advanced topics like reshaping and stacking. All concepts are illustrated with clear, beginner-friendly examples, making it ideal for anyone aiming to boost their data handling skills.

#NumPy #Python #DataScience #MachineLearning #AI #BigData #DeepLearning #DataAnalysis


🌟 Join the communities:
βœ‰οΈ Our Telegram channels: https://xn--r1a.website/addlist/0f6vfFbEMdAwODBk

πŸ“± Our WhatsApp channel: https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
Please open Telegram to view this post
VIEW IN TELEGRAM
❀4πŸ‘1
Polars.pdf
391.5 KB
πŸ“– A comprehensive cheat sheet for working with Polars


🌟 Have you ever worked with pandas and thought that was the fastest way? I thought the same thing until I worked with Polars.

✏️ This cheat sheet explains everything about Polars in a concise and simple way. Not just theory! But also a bunch of real examples, practical experience, and projects that will really help you in the real world.

β”Œ πŸ»β€β„οΈ Polars Cheat Sheet
β”œ ♾️ Google Colab
β”” πŸ“– Doc

#Polars #DataEngineering #PythonLibraries #PandasAlternative #PolarsCheatSheet #DataScienceTools #FastDataProcessing #GoogleColab #DataAnalysis #PythonForDataScience
ο»Ώ
βœ‰οΈ Our Telegram channels: https://xn--r1a.website/addlist/0f6vfFbEMdAwODBk

πŸ“± Our WhatsApp channel: https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
Please open Telegram to view this post
VIEW IN TELEGRAM
❀8πŸ‘1
πŸ₯‡ 40+ Real and Free Data Science Projects

πŸ‘¨πŸ»β€πŸ’» Real learning means implementing ideas and building prototypes. It's time to skip the repetitive training and get straight to real data science projects!

πŸ”† With the DataSimple.education website, you can access 40+ data science projects with Python completely free ! From data analysis and machine learning to deep learning and AI.

✏️ There are no beginner projects here; you work with real datasets. Each project is well thought out and guides you step by step. For example, you can build a stock forecasting model, analyze customer behavior, or even study the impact of major global events on your data.

β”ŒπŸ³οΈβ€πŸŒˆ 40+ Python Data Science Projects
β”” 🌎 Website

#DataScience #PythonProjects #MachineLearning #DeepLearning #AIProjects #RealWorldData #OpenSource #DataAnalysis #ProjectBasedLearning #LearnByBuilding


βœ‰οΈ Our Telegram channels: https://xn--r1a.website/addlist/0f6vfFbEMdAwODBk

πŸ“± Our WhatsApp channel: https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
Please open Telegram to view this post
VIEW IN TELEGRAM
❀7πŸ‘1
Topic: Python SciPy – From Easy to Top: Part 5 of 6: Working with SciPy Statistics

---

1. Introduction to `scipy.stats`

β€’ The scipy.stats module contains a large number of probability distributions and statistical functions.
β€’ You can perform tasks like descriptive statistics, hypothesis testing, sampling, and fitting distributions.

---

2. Descriptive Statistics

Use these functions to summarize and describe data characteristics:

from scipy import stats
import numpy as np

data = [2, 4, 4, 4, 5, 5, 7, 9]

mean = np.mean(data)
median = np.median(data)
mode = stats.mode(data, keepdims=True)
std_dev = np.std(data)

print("Mean:", mean)
print("Median:", median)
print("Mode:", mode.mode[0])
print("Standard Deviation:", std_dev)


---

3. Probability Distributions

SciPy has built-in continuous and discrete distributions such as normal, binomial, Poisson, etc.

Normal Distribution Example

from scipy.stats import norm

# PDF at x = 0
print("PDF at 0:", norm.pdf(0, loc=0, scale=1))

# CDF at x = 1
print("CDF at 1:", norm.cdf(1, loc=0, scale=1))

# Generate 5 random numbers
samples = norm.rvs(loc=0, scale=1, size=5)
print("Random Samples:", samples)


---

4. Hypothesis Testing

One-sample t-test – test if the mean of a sample is equal to a known value:

sample = [5.1, 5.3, 5.5, 5.7, 5.9]
t_stat, p_val = stats.ttest_1samp(sample, popmean=5.0)

print("T-statistic:", t_stat)
print("P-value:", p_val)


Interpretation: If the p-value is less than 0.05, reject the null hypothesis.

---

5. Two-sample t-test

Test if two samples come from populations with equal means:

group1 = [20, 22, 19, 24, 25]
group2 = [28, 27, 26, 30, 31]

t_stat, p_val = stats.ttest_ind(group1, group2)

print("T-statistic:", t_stat)
print("P-value:", p_val)


---

6. Chi-Square Test for Independence

Use to test independence between two categorical variables:

# Example contingency table
data = [[10, 20], [20, 40]]
chi2, p, dof, expected = stats.chi2_contingency(data)

print("Chi-square statistic:", chi2)
print("P-value:", p)


---

7. Correlation and Covariance

Measure linear relationship between variables:

x = [1, 2, 3, 4, 5]
y = [2, 4, 6, 8, 10]

corr, _ = stats.pearsonr(x, y)
print("Pearson Correlation Coefficient:", corr)


Covariance:

cov_matrix = np.cov(x, y)
print("Covariance Matrix:\n", cov_matrix)


---

8. Fitting Distributions to Data

You can fit a distribution to real-world data:

data = np.random.normal(loc=50, scale=10, size=1000)
params = norm.fit(data) # returns mean and std dev

print("Fitted mean:", params[0])
print("Fitted std dev:", params[1])


---

9. Sampling from Distributions

Generate random numbers from different distributions:

# Binomial distribution
samples = stats.binom.rvs(n=10, p=0.5, size=10)
print("Binomial Samples:", samples)

# Poisson distribution
samples = stats.poisson.rvs(mu=3, size=10)
print("Poisson Samples:", samples)


---

10. Summary

β€’ scipy.stats is a powerful tool for statistical analysis.
β€’ You can compute summaries, perform tests, model distributions, and generate random samples.

---

Exercise

β€’ Generate 1000 samples from a normal distribution and compute mean, median, std, and mode.
β€’ Test if a sample has a mean significantly different from 5.
β€’ Fit a normal distribution to your own dataset and plot the histogram with the fitted PDF curve.

---

#Python #SciPy #Statistics #HypothesisTesting #DataAnalysis

https://xn--r1a.website/DataScienceM
❀5
Please open Telegram to view this post
VIEW IN TELEGRAM
❀2
πŸ€–πŸ§  PyMuPDF: The Ultimate Python Library for High-Performance PDF Processing

πŸ—“οΈ 09 Oct 2025
πŸ“š AI News & Trends

If you’re a Python developer working with PDF documents whether it’s for text extraction, data analysis conversion or annotation then you’ve likely encountered the limitations of traditional tools. That’s where PyMuPDF also known as fitz, shines. It’s a lightweight, high-performance Python library that enables comprehensive PDF manipulation with minimal dependencies and maximum flexibility. In this ...

#PyMuPDF #PythonLibrary #PDFProcessing #TextExtraction #DataAnalysis #HighPerformance
❀1
πŸ€–πŸ§  PandasAI: Transforming Data Analysis with Conversational Artificial Intelligence

πŸ—“οΈ 28 Oct 2025
πŸ“š AI News & Trends

In a world dominated by data, the ability to analyze and interpret information efficiently has become a core competitive advantage. From business intelligence dashboards to large-scale machine learning models, data-driven decision-making fuels innovation across industries. Yet, for most people, data analysis remains a technical challenge requiring coding expertise, statistical knowledge and familiarity with libraries like ...

#PandasAI #ConversationalAI #DataAnalysis #ArtificialIntelligence #DataScience #MachineLearning
❀1
πŸ’‘ Pandas Cheatsheet

A quick guide to essential Pandas operations for data manipulation, focusing on creating, selecting, filtering, and grouping data in a DataFrame.

1. Creating a DataFrame
The primary data structure in Pandas is the DataFrame. It's often created from a dictionary.
import pandas as pd

data = {'Name': ['Alice', 'Bob', 'Charlie'],
'Age': [25, 32, 28],
'City': ['New York', 'Paris', 'New York']}
df = pd.DataFrame(data)

print(df)
# Name Age City
# 0 Alice 25 New York
# 1 Bob 32 Paris
# 2 Charlie 28 New York

β€’ A dictionary is defined where keys become column names and values become the data in those columns. pd.DataFrame() converts it into a tabular structure.

2. Selecting Data with .loc and .iloc
Use .loc for label-based selection and .iloc for integer-position based selection.
# Select the first row by its integer position (0)
print(df.iloc[0])

# Select the row with index label 1 and only the 'Name' column
print(df.loc[1, 'Name'])

# Output for df.iloc[0]:
# Name Alice
# Age 25
# City New York
# Name: 0, dtype: object
#
# Output for df.loc[1, 'Name']:
# Bob

β€’ .iloc[0] gets all data from the row at index position 0.
β€’ .loc[1, 'Name'] gets the data at the intersection of index label 1 and column label 'Name'.

3. Filtering Data
Select subsets of data based on conditions.
# Select rows where Age is greater than 27
filtered_df = df[df['Age'] > 27]
print(filtered_df)
# Name Age City
# 1 Bob 32 Paris
# 2 Charlie 28 New York

β€’ The expression df['Age'] > 27 creates a boolean Series (True/False).
β€’ Using this Series as an index df[...] returns only the rows where the value was True.

4. Grouping and Aggregating
The "group by" operation involves splitting data into groups, applying a function, and combining the results.
# Group by 'City' and calculate the mean age for each city
city_ages = df.groupby('City')['Age'].mean()
print(city_ages)
# City
# New York 26.5
# Paris 32.0
# Name: Age, dtype: float64

β€’ .groupby('City') splits the DataFrame into groups based on unique city values.
β€’ ['Age'].mean() then calculates the mean of the 'Age' column for each of these groups.

#Python #Pandas #DataAnalysis #DataScience #Programming

━━━━━━━━━━━━━━━
By: @DataScienceM ✨
❀2πŸ‘1
#Pandas #DataAnalysis #Python #DataScience #Tutorial

Top 30 Pandas Functions & Methods

This lesson covers 30 essential Pandas functions for data manipulation and analysis, each with a standalone example and its output.

---

1. pd.DataFrame()
Creates a new DataFrame (a 2D labeled data structure) from various inputs like dictionaries or lists.

import pandas as pd
data = {'col1': [1, 2], 'col2': [3, 4]}
df = pd.DataFrame(data)
print(df)

col1  col2
0 1 3
1 2 4


---

2. pd.Series()
Creates a new Series (a 1D labeled array).

import pandas as pd
s = pd.Series([10, 20, 30, 40], name='MyNumbers')
print(s)

0    10
1 20
2 30
3 40
Name: MyNumbers, dtype: int64


---

3. pd.read_csv()
Reads data from a CSV file into a DataFrame. (Assuming a file data.csv exists).

# Create a dummy csv file first
with open('data.csv', 'w') as f:
f.write('Name,Age\nAlice,25\nBob,30')

df = pd.read_csv('data.csv')
print(df)

Name  Age
0 Alice 25
1 Bob 30


---

4. df.to_csv()
Writes a DataFrame to a CSV file.

import pandas as pd
df = pd.DataFrame({'Name': ['Charlie'], 'Age': [35]})
# index=False prevents writing the DataFrame index to the file
df.to_csv('output.csv', index=False)
# You can check that 'output.csv' has been created.
print("File 'output.csv' created.")

File 'output.csv' created.

#PandasIO #DataFrame #Series

---

5. df.head()
Returns the first n rows of the DataFrame (default is 5).

import pandas as pd
data = {'Name': ['A', 'B', 'C', 'D', 'E', 'F'], 'Value': [1, 2, 3, 4, 5, 6]}
df = pd.DataFrame(data)
print(df.head(3))

Name  Value
0 A 1
1 B 2
2 C 3


---

6. df.tail()
Returns the last n rows of the DataFrame (default is 5).

import pandas as pd
data = {'Name': ['A', 'B', 'C', 'D', 'E', 'F'], 'Value': [1, 2, 3, 4, 5, 6]}
df = pd.DataFrame(data)
print(df.tail(2))

Name  Value
4 E 5
5 F 6


---

7. df.info()
Provides a concise summary of the DataFrame, including data types and non-null values.

import pandas as pd
import numpy as np
data = {'col1': [1, 2, 3], 'col2': [4.0, 5.0, np.nan], 'col3': ['A', 'B', 'C']}
df = pd.DataFrame(data)
df.info()

<class 'pandas.core.frame.DataFrame'>
RangeIndex: 3 entries, 0 to 2
Data columns (total 3 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 col1 3 non-null int64
1 col2 2 non-null float64
2 col3 3 non-null object
dtypes: float64(1), int64(1), object(1)
memory usage: 200.0+ bytes


---

8. df.shape
Returns a tuple representing the dimensionality (rows, columns) of the DataFrame.

import pandas as pd
df = pd.DataFrame({'A': [1, 2], 'B': [3, 4], 'C': [5, 6]})
print(df.shape)

(2, 3)

#DataInspection #PandasBasics

---

9. df.describe()
Generates descriptive statistics for numerical columns (count, mean, std, min, max, etc.).

import pandas as pd
df = pd.DataFrame({'Age': [22, 38, 26, 35, 29]})
print(df.describe())
❀4