Python | Machine Learning | Coding | R
63.7K subscribers
1.13K photos
68 videos
144 files
790 links
Help and ads: @hussein_sheikho

Discover powerful insights with Python, Machine Learning, Coding, and Rβ€”your essential toolkit for data-driven solutions, smart alg

List of our channels:
https://t.me/addlist/8_rRW2scgfRhOTc0

https://telega.io/?r=nikapsOH
Download Telegram
πŸ”₯ The coolest AI bot on Telegram

πŸ’’ Completely free and knows everything, from simple questions to complex problems.

β˜•οΈ Helps you with anything in the easiest and fastest way possible.

♨️ You can even choose girlfriend or boyfriend mode and chat as if you’re talking to a real person πŸ˜‹

πŸ’΅ Includes weekly and monthly airdrops!❗️

πŸ˜΅β€πŸ’« Bot ID: @chatgpt_officialbot

πŸ’Ž The best part is, even group admins can use it right inside their groups! ✨

πŸ“Ί Try now:

β€’ Type FunFact! for a jaw-dropping AI trivia.
β€’ Type RecipePlease! for a quick, tasty meal idea.
β€’ Type JokeTime! for an instant laugh.

Or just say Surprise me! and I'll pick something awesome for you. πŸ€–βœ¨
❀13πŸ”₯4πŸ‘3
This media is not supported in your browser
VIEW IN TELEGRAM
GPU by hand ✍️ I drew this to show how a GPU speeds up an array operation of 8 elements in parallel over 4 threads in 2 clock cycles. Read more πŸ‘‡

CPU
β€’ It has one core.
β€’ Its global memory has 120 locations (0-119).
β€’ To use the GPU, it needs to copy data from the global memory to the GPU.
β€’ After GPU is done, it will copy the results back.

GPU
β€’ It has four cores to run four threads (0-3).
β€’ It has a register file of 28 locations (0-27)
β€’ This register file has four banks (0-3).
β€’ All threads share the same register file.
β€’ But they must read/write using the four banks.
β€’ Each bank allows 2 reads (Read 0, Read 1) and 1 write in a single clock cycle.

#AIEngineering #MachineLearning #DeepLearning #LLMs #RAG #MLOps #Python #GitHubProjects #AIForBeginners #ArtificialIntelligence #NeuralNetworks #OpenSourceAI #DataScienceCareers


βœ‰οΈ Our Telegram channels: https://t.me/addlist/0f6vfFbEMdAwODBk
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘5❀3
❗️ JAY HELPS EVERYONE EARN MONEY!$29,000 HE'S GIVING AWAY TODAY!

Everyone can join his channel and make money! He gives away from $200 to $5.000 every day in his channel

https://t.me/+LgzKy2hA4eY0YWNl

⚑️FREE ONLY FOR THE FIRST 500 SUBSCRIBERS! FURTHER ENTRY IS PAID! πŸ‘†πŸ‘‡

https://t.me/+LgzKy2hA4eY0YWNl
❀7
What is torch.nn really?

When I started working with PyTorch, my biggest question was: "What is torch.nn?".


This article explains it quite well.

πŸ“Œ Read

#pytorch #AIEngineering #MachineLearning #DeepLearning #LLMs #RAG #MLOps #Python #GitHubProjects #AIForBeginners #ArtificialIntelligence #NeuralNetworks #OpenSourceAI #DataScienceCareers


βœ‰οΈ Our Telegram channels: https://t.me/addlist/0f6vfFbEMdAwODBk
Please open Telegram to view this post
VIEW IN TELEGRAM
❀4
πŸ˜‰ A list of the best YouTube videos
βœ… To learn data science


1️⃣ SQL language


⬅️ Learning

πŸ’° 4-hour SQL course from zero to one hundred

πŸ’° Window functions tutorial

⬅️ Projects

πŸ“Ž Starting your first SQL project

πŸ’° Data cleansing project

πŸ’° Restaurant order analysis

⬅️ Interview

πŸ’° How to crack the SQL interview?

βž–βž–βž–

2️⃣ Python


⬅️ Learning

πŸ’° 12-hour Python for Data Science course

⬅️ Projects

πŸ’° Python project for beginners

πŸ’° Analyzing Corona Data with Python

⬅️ Interview

πŸ’° Python interview golden tricks

πŸ’° Python Interview Questions

βž–βž–βž–

3️⃣ Statistics and machine learning


⬅️ Learning

πŸ’° 7-hour course in applied statistics

πŸ’° Machine Learning Training Playlist

⬅️ Projects

πŸ’° Practical ML Project

⬅️ Interview

πŸ’° ML Interview Questions and Answers

πŸ’° How to pass a statistics interview?

βž–βž–βž–

4️⃣ Product and business case studies


⬅️ Learning

πŸ’° Building strong product understanding

πŸ’° Product Metric Definition

⬅️ Interview

πŸ’° Case Study Analysis Framework

πŸ’° How to shine in a business interview?

#DataScience #SQL #Python #MachineLearning #Statistics #BusinessAnalytics #ProductCaseStudies #DataScienceProjects #InterviewPrep #LearnDataScience #YouTubeLearning #CodingInterview #MLInterview #SQLProjects #PythonForDataScience



βœ‰οΈ Our Telegram channels: https://t.me/addlist/0f6vfFbEMdAwODBk
Please open Telegram to view this post
VIEW IN TELEGRAM
❀14πŸ‘3πŸŽ‰1
NUMPY FOR DS.pdf
4.5 MB
Let's start at the top...

NumPy contains a broad array of functionality for fast numerical & mathematical operations in Python

The core data-structure within #NumPy is an ndArray (or n-dimensional array)

Behind the scenes - much of the NumPy functionality is written in the programming language C

NumPy functionality is used in other popular #Python packages including #Pandas, #Matplotlib, & #scikitlearn!

βœ‰οΈ Our Telegram channels: https://t.me/addlist/0f6vfFbEMdAwODBk
Please open Telegram to view this post
VIEW IN TELEGRAM
❀18
πŸš€ THE 7-DAY PROFIT CHALLENGE! πŸš€

Can you turn $100 into $5,000 in just 7 days?
Jay can. And she’s challenging YOU to do the same. πŸ‘‡

https://t.me/+QOcycXvRiYs4YTk1
https://t.me/+QOcycXvRiYs4YTk1
https://t.me/+QOcycXvRiYs4YTk1
❀4
Topic: Handling Datasets of All Types – Part 1 of 5: Introduction and Basic Concepts

---

1. What is a Dataset?

β€’ A dataset is a structured collection of data, usually organized in rows and columns, used for analysis or training machine learning models.

---

2. Types of Datasets

β€’ Structured Data: Tables, spreadsheets with rows and columns (e.g., CSV, Excel).

β€’ Unstructured Data: Images, text, audio, video.

β€’ Semi-structured Data: JSON, XML files containing hierarchical data.

---

3. Common Dataset Formats

β€’ CSV (Comma-Separated Values)

β€’ Excel (.xls, .xlsx)

β€’ JSON (JavaScript Object Notation)

β€’ XML (eXtensible Markup Language)

β€’ Images (JPEG, PNG, TIFF)

β€’ Audio (WAV, MP3)

---

4. Loading Datasets in Python

β€’ Use libraries like pandas for structured data:

import pandas as pd
df = pd.read_csv('data.csv')


β€’ Use libraries like json for JSON files:

import json
with open('data.json') as f:
data = json.load(f)


---

5. Basic Dataset Exploration

β€’ Check shape and size:

print(df.shape)


β€’ Preview data:

print(df.head())


β€’ Check for missing values:

print(df.isnull().sum())


---

6. Summary

β€’ Understanding dataset types is crucial before processing.

β€’ Loading and exploring datasets helps identify cleaning and preprocessing needs.

---

Exercise

β€’ Load a CSV and JSON dataset in Python, print their shapes, and identify missing values.

---

#DataScience #Datasets #DataLoading #Python #DataExploration

The rest of the parts πŸ‘‡
https://t.me/DataScienceM 🌟
Please open Telegram to view this post
VIEW IN TELEGRAM
❀22
Topic: Python Script to Convert a Shared ChatGPT Link to PDF – Step-by-Step Guide

---

### Objective

In this lesson, we’ll build a Python script that:

β€’ Takes a ChatGPT share link (e.g., https://chat.openai.com/share/abc123)
β€’ Downloads the HTML content of the chat
β€’ Converts it to a PDF file using pdfkit and wkhtmltopdf

This is useful for archiving, sharing, or printing ChatGPT conversations in a clean format.

---

### 1. Prerequisites

Before starting, you need the following libraries and tools:

#### β€’ Install pdfkit and requests

pip install pdfkit requests


#### β€’ Install wkhtmltopdf

Download from:
https://wkhtmltopdf.org/downloads.html

Make sure to add the path of the installed binary to your system PATH.

---

### 2. Python Script: Convert Shared ChatGPT URL to PDF

import pdfkit
import requests
import os

# Define output filename
output_file = "chatgpt_conversation.pdf"

# ChatGPT shared URL (user input)
chat_url = input("Enter the ChatGPT share URL: ").strip()

# Verify the URL format
if not chat_url.startswith("https://chat.openai.com/share/"):
print("Invalid URL. Must start with https://chat.openai.com/share/")
exit()

try:
# Download HTML content
response = requests.get(chat_url)
if response.status_code != 200:
raise Exception(f"Failed to load the chat: {response.status_code}")

html_content = response.text

# Save HTML to temporary file
with open("temp_chat.html", "w", encoding="utf-8") as f:
f.write(html_content)

# Convert HTML to PDF
pdfkit.from_file("temp_chat.html", output_file)

print(f"\nβœ… PDF saved as: {output_file}")

# Optional: remove temp file
os.remove("temp_chat.html")

except Exception as e:
print(f"❌ Error: {e}")


---

### 3. Notes

β€’ This approach works only if the shared page is publicly accessible (which ChatGPT share links are).
β€’ The PDF output will contain the web page version, including theme and layout.
β€’ You can customize the PDF output using pdfkit options (like page size, margins, etc.).

---

### 4. Optional Enhancements

β€’ Add GUI with Tkinter
β€’ Accept multiple URLs
β€’ Add PDF metadata (title, author, etc.)
β€’ Add support for offline rendering using BeautifulSoup to clean content

---

### Exercise

β€’ Try converting multiple ChatGPT share links to PDF
β€’ Customize the styling with your own CSS
β€’ Add a timestamp or watermark to the PDF

---

#Python #ChatGPT #PDF #WebScraping #Automation #pdfkit #tkinter

https://t.me/CodeProgrammer βœ…
Please open Telegram to view this post
VIEW IN TELEGRAM
❀23πŸ’―1
πŸ™πŸ’Έ 500$ FOR THE FIRST 500 WHO JOIN THE CHANNEL! πŸ™πŸ’Έ

Join our channel today for free! Tomorrow it will cost 500$!

https://t.me/+QHlfCJcO2lRjZWVl

You can join at this link! πŸ‘†πŸ‘‡

https://t.me/+QHlfCJcO2lRjZWVl
❀4πŸ‘1
Python | Machine Learning | Coding | R
Photo
# πŸ“š Python Tutorial: Convert EPUB to PDF (Preserving Images)
#Python #EPUB #PDF #EbookConversion #Automation

This comprehensive guide will show you how to convert EPUB files (including those with images) to high-quality PDFs using Python.

---

## πŸ”Ή Required Tools & Libraries
We'll use these Python packages:
- ebooklib - For EPUB parsing
- pdfkit (wrapper for wkhtmltopdf) - For PDF generation
- Pillow - For image handling (optional)

pip install ebooklib pdfkit pillow


Also install system dependencies:
# On Ubuntu/Debian
sudo apt-get install wkhtmltopdf

# On MacOS
brew install wkhtmltopdf

# On Windows (download from wkhtmltopdf.org)


---

## πŸ”Ή Step 1: Extract EPUB Contents
First, we'll unpack the EPUB file to access its HTML and images.

from ebooklib import epub
from bs4 import BeautifulSoup
import os

def extract_epub(epub_path, output_dir):
book = epub.read_epub(epub_path)

# Create output directory
os.makedirs(output_dir, exist_ok=True)

# Extract all items (chapters, images, styles)
for item in book.get_items():
if item.get_type() == epub.ITEM_IMAGE:
# Save images
with open(os.path.join(output_dir, item.get_name()), 'wb') as f:
f.write(item.get_content())
elif item.get_type() == epub.ITEM_DOCUMENT:
# Save HTML chapters
with open(os.path.join(output_dir, item.get_name()), 'wb') as f:
f.write(item.get_content())

return [item.get_name() for item in book.get_items() if item.get_type() == epub.ITEM_DOCUMENT]


---

## πŸ”Ή Step 2: Convert HTML to PDF
Now we'll convert the extracted HTML files to PDF while preserving images.

import pdfkit
from PIL import Image # For image validation (optional)

def html_to_pdf(html_files, output_pdf, base_dir):
options = {
'encoding': "UTF-8",
'quiet': '',
'enable-local-file-access': '', # Critical for local images
'no-outline': None,
'margin-top': '15mm',
'margin-right': '15mm',
'margin-bottom': '15mm',
'margin-left': '15mm',
}

# Validate images (optional)
for html_file in html_files:
soup = BeautifulSoup(open(os.path.join(base_dir, html_file)), 'html.parser')
for img in soup.find_all('img'):
img_path = os.path.join(base_dir, img['src'])
try:
Image.open(img_path) # Validate image
except Exception as e:
print(f"Image error in {html_file}: {e}")
img.decompose() # Remove broken images

# Convert to PDF
pdfkit.from_file(
[os.path.join(base_dir, f) for f in html_files],
output_pdf,
options=options
)


---

## πŸ”Ή Step 3: Complete Conversion Function
Combine everything into a single workflow.

def epub_to_pdf(epub_path, output_pdf, temp_dir="temp_epub"):
try:
print(f"Converting {epub_path} to PDF...")

# Step 1: Extract EPUB
print("Extracting EPUB contents...")
html_files = extract_epub(epub_path, temp_dir)

# Step 2: Convert to PDF
print("Generating PDF...")
html_to_pdf(html_files, output_pdf, temp_dir)

print(f"Success! PDF saved to {output_pdf}")
return True

except Exception as e:
print(f"Conversion failed: {str(e)}")
return False
finally:
# Clean up temporary files
if os.path.exists(temp_dir):
import shutil
shutil.rmtree(temp_dir)


---

## πŸ”Ή Advanced Options
### 1. Custom Styling
Add CSS to improve PDF appearance:

def html_to_pdf(html_files, output_pdf, base_dir):
options = {
# ... previous options ...
'user-style-sheet': 'styles.css', # Custom CSS
}

# Create CSS file if needed
css = """
body { font-family: "Times New Roman", serif; font-size: 12pt; }
img { max-width: 100%; height: auto; }
"""
with open(os.path.join(base_dir, 'styles.css'), 'w') as f:
f.write(css)

pdfkit.from_file(/* ... */)
πŸ”₯2❀1
Python | Machine Learning | Coding | R
Photo
### 2. Handling Complex EPUBs
For problematic EPUBs, try this pre-processing:

def clean_html(html_file):
with open(html_file, 'r+', encoding='utf-8') as f:
content = f.read()
soup = BeautifulSoup(content, 'html.parser')

# Remove problematic elements
for element in soup(['script', 'iframe', 'object']):
element.decompose()

# Fix image paths
for img in soup.find_all('img'):
if not os.path.isabs(img['src']):
img['src'] = os.path.abspath(os.path.join(os.path.dirname(html_file), img['src']))

# Write back cleaned HTML
f.seek(0)
f.write(str(soup))
f.truncate()


---

## πŸ”Ή Full Usage Example
if __name__ == "__main__":
import argparse

parser = argparse.ArgumentParser(description='Convert EPUB to PDF')
parser.add_argument('epub_file', help='Input EPUB file path')
parser.add_argument('pdf_file', help='Output PDF file path')
args = parser.parse_args()

success = epub_to_pdf(args.epub_file, args.pdf_file)
if not success:
exit(1)


Run from command line:
python epub_to_pdf.py input.epub output.pdf


---

## πŸ”Ή Troubleshooting Common Issues
| Problem | Solution |
|---------|----------|
| Missing images | Ensure enable-local-file-access is set |
| Broken CSS paths | Use absolute paths in CSS references |
| Encoding issues | Specify UTF-8 in both HTML and pdfkit options |
| Large file sizes | Optimize images before conversion |
| Layout problems | Add CSS media queries for print |

---

## πŸ”Ή Alternative Libraries
If pdfkit doesn't meet your needs:

1. WeasyPrint (pure Python)

   pip install weasyprint


2. PyMuPDF (fitz)

   pip install pymupdf


3. Calibre's ebook-convert CLI

   ebook-convert input.epub output.pdf


---

## πŸ”Ή Best Practices
1. Always clean temporary files after conversion
2. Validate input EPUBs before processing
3. Handle metadata (title, author, etc.)
4. Batch process multiple files with threading
5. Log conversion results for debugging

---

### πŸ“š Final Notes
This solution preserves:
βœ”οΈ All images in original quality
βœ”οΈ Chapter structure and formatting
βœ”οΈ Text encoding and special characters

For production use, consider adding:
- Progress tracking
- Parallel conversion of chapters
- EPUB metadata preservation
- Custom cover page support

#PythonAutomation #EbookTools #PDFConversion πŸš€

Try enhancing this script by:
1. Adding a progress bar
2. Preserving table of contents
3. Supporting custom cover pages
4. Creating a GUI version

https://t.me/CodeProgrammer ❀️
❀10
This channels is for Programmers, Coders, Software Engineers.

0️⃣ Python
1️⃣ Data Science
2️⃣ Machine Learning
3️⃣ Data Visualization
4️⃣ Artificial Intelligence
5️⃣ Data Analysis
6️⃣ Statistics
7️⃣ Deep Learning
8️⃣ programming Languages

βœ… https://t.me/addlist/8_rRW2scgfRhOTc0

βœ… https://t.me/Codeprogrammer
Please open Telegram to view this post
VIEW IN TELEGRAM
❀2πŸ’―2
Please open Telegram to view this post
VIEW IN TELEGRAM
❀2
πŸ“š JaidedAI/EasyOCR β€” an open-source Python library for Optical Character Recognition (OCR) that's easy to use and supports over 80 languages out of the box.

### πŸ” Key Features:

πŸ”Έ Extracts text from images and scanned documents β€” including handwritten notes and unusual fonts
πŸ”Έ Supports a wide range of languages like English, Russian, Chinese, Arabic, and more
πŸ”Έ Built on PyTorch β€” uses modern deep learning models (not the old-school Tesseract)
πŸ”Έ Simple to integrate into your Python projects

### βœ… Example Usage:

import easyocr

reader = easyocr.Reader(['en', 'ru']) # Choose supported languages
result = reader.readtext('image.png')


### πŸ“Œ Ideal For:

βœ… Text extraction from photos, scans, and documents
βœ… Embedding OCR capabilities in apps (e.g. automated data entry)

πŸ”— GitHub: https://github.com/JaidedAI/EasyOCR

πŸ‘‰ Follow us for more: @DataScienceN

#Python #OCR #MachineLearning #ComputerVision #EasyOCR
❀1πŸ‘Ž1πŸŽ‰1
Ready to finally master the Wheel Strategy and grow real wealth with low-risk global ETFs?
See how disciplined investors are building long-term incomeβ€”plus tips on U.S. vs. European ETF taxes most miss.

Don’t just read about financial freedomβ€”start taking control of your future here.
Exclusive lessons & real tradesβ€”join now!

#Ψ₯ΨΉΩ„Ψ§Ω† InsideAds - Ψͺرويج
❀2
Transformer Lesson - Part 1/7: Introduction and Architecture

Let's start:
https://hackmd.io/@husseinsheikho/transformers

βœ‰οΈ Our Telegram channels: https://t.me/addlist/0f6vfFbEMdAwODBk

πŸ“± Our WhatsApp channel: https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
❀5πŸ‘2