Lecture
Frequently Used External Packages in Python
An external package refers to a library developed externally to enhance programming convenience.
You can install external packages using Python's own package management system, pip.
Installing External Packages with pip
$ pip install requests # Install the requests package for making network requests
Frequently Used External Packages
-
requests- A library for making HTTP requests. It is often used for web scraping and API calls.
-
numpy- A library for high-performance numerical computations. It efficiently handles multi-dimensional arrays and is widely used in scientific and engineering calculations.
-
pandas- A library for data analysis and manipulation, offering a variety of functionalities to efficiently manage structured data. It makes it easy to handle various data formats with a focus on data frames (DataFrame).
-
matplotlib- A library for creating 2D graphics and plots. It is mainly used for data visualization.
-
scikit-learn- A library providing machine learning algorithms. It is used for tasks like classification, regression, and clustering.
-
flask, django- Frameworks for developing web applications. Flask is suitable for simple and lightweight web app development, while Django is more powerful and feature-rich for robust web app development.
-
Beautiful Soup- A library for extracting data from HTML and XML files, mainly used for web scraping.
External Package Usage Example
Example Using the requests Package
# Fetching the content of a web page using the requests package import requests # Import the requests package response = requests.get('https://example.com') # Send a request to the URL and receive a response print(response.text) # Print the response content
Lessons in this chapter · Introduction to Python Web Scraping
- 1. Web Crawling - Collecting Data with Python Code
- 2. Differences Between Web Crawling and Web Scraping
- 3. Legal and Ethical Responsibilities in Web Crawling
- 4. Multiple-choice quiz
- 5. What is a Module?
- 6. Key Python Built-in Modules
- 7. Frequently Used External Packages in Python
- 8. Fill-in-the-blank quiz
- 9. HTML Basics for Web Crawling
- 10. Using CSS Selectors for Web Crawling
- 11. Multiple-choice quiz
Lecture
AI Tutor
Design
Upload
Notes
Favorites
Help