Scrap Image from google using BeautifulSoup
import requests
from bs4 import BeautifulSoup as BSP
def get_image_urls(search_query):
url = f"https://www.google.com/search?q={search_query}&tbm=isch"
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3"
}
rss = requests.get(url, headers=headers)
soup = BSP(rss.content, "html.parser")
all_img = []
for img in soup.find_all('img'):
src = img['src']
if not src.endswith("gif"):
all_img.append(src)
return all_img
print(get_image_urls("boy"))
π20
Scrap Image from bing using BeautifulSoup
sample response :
import requests
from bs4 import BeautifulSoup as BSP
def split_url(url):
return url.split('&')[0]
def get_image_urls(search_query):
url = f"https://cn.bing.com/images/search?q={search_query}&first=1&cw=1177&ch=678"
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3"
}
rss = requests.get(url, headers=headers)
soup = BSP(rss.content, "html.parser")
all_img = []
for img in soup.find_all('img'):
img_url = img.get('src2')
if img_url and img_url.startswith('https://tse2.mm.bing.net/'):
img_url = split_url(img_url)
all_img.append(img_url)
return all_img
print(get_image_urls("cat"))
sample response :
['https://tse2.mm.bing.net/th?q=Cat+Portrait', ...']
π19
Tips to Merge two dictionary
boy={"ram":70,"Sundar":80}
girl={"riya":80,"Sonali":70}
student=boy | girl
print(student)
π23
Essential Python Libraries for Data Analytics ππ
Python Free Resources: https://t.me/pythondevelopersindia
1. NumPy:
- Efficient numerical operations and array manipulation.
2. Pandas:
- Data manipulation and analysis with powerful data structures (DataFrame, Series).
3. Matplotlib:
- 2D plotting library for creating visualizations.
4. Scikit-learn:
- Machine learning toolkit for classification, regression, clustering, etc.
5. TensorFlow:
- Open-source machine learning framework for building and deploying ML models.
6. PyTorch:
- Deep learning library, particularly popular for neural network research.
7. Django:
- High-level web framework for building robust, scalable web applications.
8. Flask:
- Lightweight web framework for building smaller web applications and APIs.
9. Requests:
- HTTP library for making HTTP requests.
10. Beautiful Soup:
- Web scraping library for pulling data out of HTML and XML files.
As a beginner, you can start with Pandas and Numpy libraries for data analysis. If you want to transition from Data Analyst to Data Scientist, then you can start applying ML libraries like Scikit-learn, Tensorflow, Pytorch, etc. in your data projects.
Share with credits: https://t.me/sqlspecialist
Hope it helps :)
Python Free Resources: https://t.me/pythondevelopersindia
1. NumPy:
- Efficient numerical operations and array manipulation.
2. Pandas:
- Data manipulation and analysis with powerful data structures (DataFrame, Series).
3. Matplotlib:
- 2D plotting library for creating visualizations.
4. Scikit-learn:
- Machine learning toolkit for classification, regression, clustering, etc.
5. TensorFlow:
- Open-source machine learning framework for building and deploying ML models.
6. PyTorch:
- Deep learning library, particularly popular for neural network research.
7. Django:
- High-level web framework for building robust, scalable web applications.
8. Flask:
- Lightweight web framework for building smaller web applications and APIs.
9. Requests:
- HTTP library for making HTTP requests.
10. Beautiful Soup:
- Web scraping library for pulling data out of HTML and XML files.
As a beginner, you can start with Pandas and Numpy libraries for data analysis. If you want to transition from Data Analyst to Data Scientist, then you can start applying ML libraries like Scikit-learn, Tensorflow, Pytorch, etc. in your data projects.
Share with credits: https://t.me/sqlspecialist
Hope it helps :)
π23
Python code To download from Youtube β
from pytube import YouTube
# Enter the YouTube video URL
url = "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
# Create a YouTube object with the URL
yt = YouTube(url)
# Select the highest resolution video
video = yt.streams.get_highest_resolution()
# Set the output directory and filename
output_dir = "/storage/emulated/0/Documents/"
filename = yt.title+".mp4"
# Download the video
video.download(output_dir, filename)
print(f"Download complete: {filename}")
π40
Building_Modern_GUIs_with_Tkinter_and_Python_Building_user_friendly.pdf
25.4 MB
Building Modern GUIs with Tkinter and Python
π20π2
π©βπ«π§βπ« PROGRAMMING LANGUAGES YOU SHOULD LEARN TO BECOME.
βοΈ[ Web Developer]
βοΈ[ Game Developer]
βοΈ[ Data Analysis]
βοΈ[ Desktop Developer]
βοΈ[ Embedded System Program]
βοΈ[Mobile Apps Development]
βοΈ[ Web Developer]
PHP, C#, JS, JAVA, Python, Ruby
βοΈ[ Game Developer]
Java, C++, Python, JS, Ruby, C, C#
βοΈ[ Data Analysis]
R, Matlab, Java, Python
βοΈ[ Desktop Developer]
Java, C#, C++, Python
βοΈ[ Embedded System Program]
C, Python, C++
βοΈ[Mobile Apps Development]
Kotlin, Dart, Objective-C, Java, Python, JS, Swift, C#
π18
Tip : Use the zip() function to iterate over multiple iterables simultaneously
Example:
Benefits:
* Simplifies the process of iterating over multiple lists or tuples
* Ensures that the elements from corresponding lists are aligned
Language:
Example:
# Create two lists
names = ["John", "Mary", "Bob"]
ages = [30, 25, 40]
# Iterate over both lists using zip()
for name, age in zip(names, ages):
print(f"{name} is {age} years old.")
Benefits:
* Simplifies the process of iterating over multiple lists or tuples
* Ensures that the elements from corresponding lists are aligned
Language:
Python
π31
π° 100 Days of Code β The Complete Python Pro Bootcamp for 2022
https://t.me/PythonInterviews/118
β± 60 Hours π¦ 230 Lessons
At 56+ hours, this Python course is without a doubt the most comprehensive Python course available anywhere online. Even if you have zero programming experience, this course will take you from beginner to professional.
Master Python by building 100 projects in 100 days. Learn data science, automation, build websites, games and apps!
Taught By: Dr. Angela Yu
Download Full Course: https://t.me/PythonInterviews/118
Download All Courses: https://t.me/pythonfreebootcamp
https://t.me/PythonInterviews/118
β± 60 Hours π¦ 230 Lessons
At 56+ hours, this Python course is without a doubt the most comprehensive Python course available anywhere online. Even if you have zero programming experience, this course will take you from beginner to professional.
Master Python by building 100 projects in 100 days. Learn data science, automation, build websites, games and apps!
Taught By: Dr. Angela Yu
Download Full Course: https://t.me/PythonInterviews/118
Download All Courses: https://t.me/pythonfreebootcamp
π24
Python.Machine.Learning.Projects.pdf
6.4 MB
Python Machine Learning Projects
ΠΠ²ΡΠΎΡ: Dr. Deepali R Vora
ΠΠ²ΡΠΎΡ: Dr. Deepali R Vora
advanced-data-science-and-analytics-with-python.pdf
22 MB
Advanced data science and analytics with python (2020)
ΠΠ²ΡΠΎΡ: JesΓΊs Rogel-Salazar
ΠΠ²ΡΠΎΡ: JesΓΊs Rogel-Salazar
π18
Convert Image to text
import pytesseract as t
from PIL import Image
img = Image.open("photo.jpg")
text = t.image_to_string(img)
print(text)
π28
β¨οΈ Extract Text from PDFs with Python
Need to extract text from PDF files? Python makes it easy with the PyPDF2 library!
First, install the necessary module:
Then, use this script:
Effortlessly convert PDF content into text format for easy manipulation and analysis!
Need to extract text from PDF files? Python makes it easy with the PyPDF2 library!
First, install the necessary module:
pip install PyPDF2
Then, use this script:
import PyPDF2
# https://t.me/pythonfreebootcamp
pdf_file = 'sample.pdf'
with open(pdf_file, 'rb') as file:
reader = PyPDF2.PdfFileReader(file)
text = ''
for page_num in range(reader.numPages):
page = reader.getPage(page_num)
text += page.extractText()
print(text)
Effortlessly convert PDF content into text format for easy manipulation and analysis!
π19π4