Data Science Machine Learning Data Analysis
38.9K subscribers
3.69K photos
31 videos
39 files
1.28K links
ads: @HusseinSheikho

This channel is for Programmers, Coders, Software Engineers.

1- Data Science
2- Machine Learning
3- Data Visualization
4- Artificial Intelligence
5- Data Analysis
6- Statistics
7- Deep Learning
Download Telegram
fig, ax = plt.subplots() # Single subplot
fig, axes = plt.subplots(2, 2) # 2x2 grid of subplots

• Plot on a specific subplot (Axes object).
axes[0, 0].plot(x, np.sin(x))

• Set the title for a specific subplot.
axes[0, 0].set_title('Subplot 1')

• Set labels for a specific subplot.
axes[0, 0].set_xlabel('X-axis')
axes[0, 0].set_ylabel('Y-axis')

• Add a legend to a specific subplot.
axes[0, 0].legend(['Sine'])

• Add a main title for the entire figure.
fig.suptitle('Main Figure Title')

• Automatically adjust subplot parameters for a tight layout.
plt.tight_layout()

• Share x or y axes between subplots.
fig, axes = plt.subplots(2, 1, sharex=True)

• Get the current Axes instance.
ax = plt.gca()

• Create a second y-axis that shares the x-axis.
ax2 = ax.twinx()


VI. Specialized Plots

• Create a contour plot.
X, Y = np.meshgrid(x, x)
Z = np.sin(X) * np.cos(Y)
plt.contour(X, Y, Z, levels=10)

• Create a filled contour plot.
plt.contourf(X, Y, Z)

• Create a stream plot for vector fields.
U, V = np.cos(X), np.sin(Y)
plt.streamplot(X, Y, U, V)

• Create a 3D surface plot.
from mpl_toolkits.mplot3d import Axes3D
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.plot_surface(X, Y, Z)


#Python #Matplotlib #DataVisualization #DataScience #Plotting

━━━━━━━━━━━━━━━
By: @DataScienceM
• Group data by a column.
df.groupby('col1')

• Group by a column and get the sum.
df.groupby('col1').sum()

• Apply multiple aggregation functions at once.
df.groupby('col1').agg(['mean', 'count'])

• Get the size of each group.
df.groupby('col1').size()

• Get the frequency counts of unique values in a Series.
df['col1'].value_counts()

• Create a pivot table.
pd.pivot_table(df, values='D', index=['A', 'B'], columns=['C'])


VI. Merging, Joining & Concatenating

• Merge two DataFrames (like a SQL join).
pd.merge(left_df, right_df, on='key_column')

• Concatenate (stack) DataFrames along an axis.
pd.concat([df1, df2]) # Stacks rows

• Join DataFrames on their indexes.
left_df.join(right_df, how='outer')


VII. Input & Output

• Write a DataFrame to a CSV file.
df.to_csv('output.csv', index=False)

• Write a DataFrame to an Excel file.
df.to_excel('output.xlsx', sheet_name='Sheet1')

• Read data from an Excel file.
pd.read_excel('input.xlsx', sheet_name='Sheet1')

• Read from a SQL database.
pd.read_sql_query('SELECT * FROM my_table', connection_object)


VIII. Time Series & Special Operations

• Use the string accessor (.str) for Series operations.
s.str.lower()
s.str.contains('pattern')

• Use the datetime accessor (.dt) for Series operations.
s.dt.year
s.dt.day_name()

• Create a rolling window calculation.
df['col1'].rolling(window=3).mean()

• Create a basic plot from a Series or DataFrame.
df['col1'].plot(kind='hist')


#Python #Pandas #DataAnalysis #DataScience #Programming

━━━━━━━━━━━━━━━
By: @DataScienceM
6👍1🔥1
📌 NumPy for Absolute Beginners: A Project-Based Approach to Data Analysis

🗂 Category: DATA SCIENCE

🕒 Date: 2025-11-04 | ⏱️ Read time: 14 min read

Master NumPy for data analysis with this project-based guide for absolute beginners. Learn to build a high-performance sensor data pipeline from scratch and unlock the true speed of Python for data-intensive applications.

#NumPy #Python #DataAnalysis #DataScience
📌 Train a Humanoid Robot with AI and Python

🗂 Category: ROBOTICS

🕒 Date: 2025-11-04 | ⏱️ Read time: 9 min read

Explore how to train a humanoid robot using Python and AI. This guide covers the application of 3D simulations and Reinforcement Learning, leveraging powerful tools like the MuJoCo physics engine and the Gym toolkit to create and manage sophisticated learning environments for robotics.

#AI #Robotics #Python #ReinforcementLearning #MachineLearning
1
📌 Make Python Up to 150× Faster with C

🗂 Category: PROGRAMMING

🕒 Date: 2025-11-10 | ⏱️ Read time: 14 min read

Dramatically accelerate your Python applications—up to 150x faster—by strategically offloading performance-critical code to C. This practical guide shows how to seamlessly integrate C with your existing Python projects, supercharging your code's bottlenecks without abandoning the Python ecosystem. Achieve significant performance gains where they matter most.

#Python #CProgramming #PerformanceOptimization #Coding
📌 Does More Data Always Yield Better Performance?

🗂 Category: DATA SCIENCE

🕒 Date: 2025-11-10 | ⏱️ Read time: 9 min read

Exploring and challenging the conventional wisdom of “more data → better performance” by experimenting with…

#DataScience #AI #Python
1
📌 How to Build Agents with GPT-5

🗂 Category: AGENTIC AI

🕒 Date: 2025-11-11 | ⏱️ Read time: 8 min read

Learn how to use GPT-5 as a powerful AI Agent on your data.

#DataScience #AI #Python
📌 Feature Detection, Part 2: Laplace & Gaussian Operators

🗂 Category: COMPUTER VISION

🕒 Date: 2025-11-12 | ⏱️ Read time: 12 min read

Laplace meets Gaussian — the story of two operators in edge detection

#DataScience #AI #Python
📌 Robotics with Python: Q-Learning vs Actor-Critic vs Evolutionary Algorithms

🗂 Category: Uncategorized

🕒 Date: 2025-11-13 | ⏱️ Read time: 15 min read

Explore the intersection of Python and robotics in this deep dive into reinforcement learning algorithms. The article compares the trade-offs, strengths, and weaknesses of Q-Learning, Actor-Critic, and Evolutionary Algorithms for robotic control tasks. Learn how to apply these concepts by building a custom 3D environment to train and test your own RL-powered robot, providing a practical understanding of which technique to choose for your specific application.

#Python #Robotics #ReinforcementLearning #MachineLearning #AI
📌 Spearman Correlation Coefficient for When Pearson Isn’t Enough

🗂 Category: DATA SCIENCE

🕒 Date: 2025-11-13 | ⏱️ Read time: 7 min read

Not all relationships are linear, and that is where Spearman comes in.

#DataScience #AI #Python
📌 Music, Lyrics, and Agentic AI: Building a Smart Song Explainer using Python and OpenAI

🗂 Category: LARGE LANGUAGE MODELS

🕒 Date: 2025-11-14 | ⏱️ Read time: 10 min read

This is how to build an AI-powered Song Explainer using Python and OpenAI

#DataScience #AI #Python
1
📌 The Absolute Beginner’s Guide to Pandas DataFrames

🗂 Category: DATA SCIENCE

🕒 Date: 2025-11-17 | ⏱️ Read time: 5 min read

New to the Pandas library? This beginner's guide covers the fundamental skill of creating DataFrames. Learn the essential techniques to initialize a DataFrame from common Python data structures, including dictionaries, lists, and NumPy arrays. Mastering this core concept is the perfect first step for anyone starting their data analysis journey in Python.

#Python #Pandas #DataAnalysis #DataFrames
1🔥1
📌 Javascript Fatigue: HTMX is all you need to build ChatGPT — Part 1

🗂 Category: PROGRAMMING

🕒 Date: 2025-11-17 | ⏱️ Read time: 12 min read

Tired of complex JavaScript frameworks? This article demonstrates how to build a dynamic, ChatGPT-style chatbot using a simpler stack. Learn how to leverage the power of HTMX, Python, and standard HTML to create a modern web application while minimizing your reliance on JavaScript. This first part of a series sets the foundation for building interactive UIs with a backend-centric approach, directly addressing the common issue of JavaScript fatigue.

#HTMX #Python #WebDevelopment #JavaScriptFatigue