Python libraries
Python libraries are collections of pre-written code that provide
functions, methods, and tools to help you perform specific tasks
without writing everything from scratch.
What is a Python Library?
A Python library is a bundle of modules (Python files) that offer ready-made functions to help
developers in various areas like:
•Data analysis
•Machine learning
•Web development
•Automation
•File handling, etc.
Common Python Libraries & Their Uses
Common Python Libraries & Their
Uses
Library Name Use / Purpose
For numerical computing, handling
NumPy arrays, matrices, and mathematical
functions.
For data manipulation and analysis,
Pandas especially with tabular data (like
Excel/CSV).
For creating graphs and
Matplotlib
visualizations.
Based on Matplotlib, used for
Seaborn
making statistical visualizations.
For machine learning –
Scikit-learn classification, regression, clustering,
etc.
For deep learning and neural
TensorFlow / PyTorch
networks.
🧠 Why Use Python Libraries?
• Saves time: No need to write everything from scratch.
• Reliable: Well-tested code, used by millions.
• Efficient: Optimized for performance.
• Community support: Huge Python community and documentation
available.
Key Differences:
Python list prints with
commas and brackets:
[1, 2, 3, 4, 5]
NumPy array prints
without commas: [1 2 3 4
5]
Why not just use a list?
Because NumPy arrays are:
• Faster
• More efficient in memory
• Support powerful operations (like broadcasting, matrix multiplication,
etc.)
I tried