0% found this document useful (0 votes)
56 views

Experiment No 2 Introduction To Various Python Packages and Their Basic Use

Uploaded by

chavansrushti21
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views

Experiment No 2 Introduction To Various Python Packages and Their Basic Use

Uploaded by

chavansrushti21
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

JSPM’s

Jayawantrao Sawant College of Engineering


Sr. No. 58, Handewadi Road, Hadapsar, Pune, Maharashtra 411028
Department of Electronics and Telecommunication Engineering

Experiment No. 2
Title: Introduction of various Python Packages
Aim: To Study basics of various packages in Python
CO 2 :. Utilize various data analyzing packages in Python
ELO-1: Student will be able to learn the installation and use of various packages for data
analytics
Objectives: After performing this experiment, the learner will be able to
1. Various packages useful for the data analytics.
2. Applications of the various packages in Python.
Pre-requisite: Basics of Python
What is Python?
Python is a high level, interpreted and general purpose dynamic programming language that focuses on
code readability. It has fewer steps when compared to Java and C. It was founded in 1991 by developer
Guido Van Rossum. It is used in many organizations as it supports multiple programming paradigms.
It also performs automatic memory management.
Advantages:
1) Presence of third-party modules
2) Extensive support libraries (NumPy for numerical calculations, Pandas for data analytics etc)
3) Open source and community development
4) Easy to learn
5) User-friendly data structures
6) High-level language
7) Dynamically typed language
(No need to mention data type based on value assigned, it takes data type)
8) Object-oriented language
9) Portable and Interactive
10) Portable across Operating systems
Applications:
1) GUI based desktop applications(Games, Scientific Applications)
2) Web frameworks and applications 3) Enterprise and Business applications
4) Operating Systems 5) Language Development
6) Prototyping
Organizations using Python:
1) Google(Components of Google spider and Search Engine) 2) Yahoo(Maps)
3) YouTube 4) Mozilla 5) Dropbox 6) Microsoft
7) Cisco 8) Spotify 9) Quora

A python package is a collection of modules. Modules that are related to each other
are mainly put in the same package. When a module from an external package is
required in a program, that package can be imported and its modules can be put to use.
https://www.educative.io/edpresso/what-are-python-packages

SE [Electronics and Telecommunication]/2021-22 Subject: Data Analytics Lab


JSPM’s
Jayawantrao Sawant College of Engineering
Sr. No. 58, Handewadi Road, Hadapsar, Pune, Maharashtra 411028
Department of Electronics and Telecommunication Engineering

Hardware & Software Required: Personal Computer with Anaconda based python installed.
Python Distributions
1) Anaconda 2) Enthought 3) Active State 4) Intel
Advantages of Anaconda Distribution:
 It is free and open-source
 It has more than 1500 Python/R data science packages
 Anaconda simplifies package management and deployment
 It has tools to easily collect data from sources using machine learning and AI
 It creates an environment that is easily manageable for deploying any project
 Anaconda is the industry standard for developing, testing and training on a single machine
 It has good community support- you can ask your questions there.
Packages in Python
Python packages provide a beginner-friendly and efficient way to solve complex problems in scientific
computing, data visualization, data modeling, and many other fields.
What Is a Python Package?
Complex tasks are better solved step by step, one subtask at a time. That's why programmers create
and use modules, or sets of related code saved in separate files and aimed at solving specific tasks.
When you have many different modules, you'll definitely want to group and organize them.
A Python package is a directory of a collection of modules.
Just as you organize your computer files into folders and sub-folders, you can organize modules into
packages and sub-packages.
10 Python Packages
1. NumPy
NumPy is the primary tool for scientific computing in Python. It combines the flexibility and
simplicity of Python with the speed of languages like C and Fortran.
NumPy is used for:
 Advanced array operations (e. g. add, multiply, slice, reshape, index).
 Comprehensive mathematical functions.
 Random number generation.
 Linear algebra routines.
 Fourier transforms, etc.
2. pandas
If you work with tabular, time series, or matrix data, pandas is your go-to Python package. It is known
as a fast, efficient, and easy-to-use tool for data analysis and manipulation. It works with data frame
objects; a data frame is a dedicated structure for two-dimensional data. Data frames have rows and
columns just like database tables or Excel spreadsheets.
Among other things, pandas can be used for:
 Reading/writing data from/to CSV and Excel files and SQL databases.
 Reshaping and pivoting datasets.
 Slicing, indexing, and subsetting datasets.
 Aggregating and transforming data.
 Merging and joining datasets.

SE [Electronics and Telecommunication]/2021-22 Subject: Data Analytics Lab


JSPM’s
Jayawantrao Sawant College of Engineering
Sr. No. 58, Handewadi Road, Hadapsar, Pune, Maharashtra 411028
Department of Electronics and Telecommunication Engineering

3. Matplotlib
Matplotlib is the most common data exploration and visualization library. We can use it to create basic
graphs like line plots, histograms, scatter plots, bar charts, and pie charts. We can also create animated
and interactive visualizations with this library. Matplotlib is the foundation of every other visualization
library.
The library offers a great deal of flexibility with regards to formatting and styling plots. You can freely
choose how to display labels, grids, legends, etc. However, to create complex and visually appealing
plots, you'll need to write quite a lot of code.
4. Seaborn
Seaborn is a high-level interface for drawing attractive statistical graphics with just a few lines of code.
5. Scikit-learn
Do you want to run a regression? Or maybe you have a data classification problem? scikit-learn is an
efficient and beginner-friendly tool for predictive data analysis. Among other things, you can use
scikit-learn to:
 Identify which category an object is likely to belong to (used in fraud detection, image
recognition, cancer detection, etc.).
 Predict a continuous variable based on available features (used in predicting house prices and
inflation).
 Group similar objects into clusters (used in customer segmentation, social network analysis,
etc.).
scikit-learn makes machine learning with Python accessible to people with minimal programming
experience. With just a few lines of code, you can model your data using algorithms like random
forest, support vector machines (SVM), k-means, spectral clustering, and more.
6. Requests
This library is designed to make HTTP requests with Python more responsive and user friendly.
The intuitive JSON method offered by Requests helps you avoid manually adding query strings
to URLs. With Requests, you can:
 Customize, inspect, authorize, and configure HTTP requests.
 Add parameters, headers, and multi-part files.
 Decompress data automatically.
 Upload multiple files at the same time.
This package is a real blessing for beginners and advanced users, making it one of the most downloaded
Python packages.
7. urllib3
urllib3 is another user-friendly HTTP client for Python. It is currently the most downloaded PyPi
package, and it powers Requests and some other popular Python packages. urllib3 provides many
critical features missing from the standard libraries:
 Thread safety.
 Connection pooling.
 Retrying requests.
 Dealing with HTTP redirects.
 Full test coverage.
8. NLTK

SE [Electronics and Telecommunication]/2021-22 Subject: Data Analytics Lab


JSPM’s
Jayawantrao Sawant College of Engineering
Sr. No. 58, Handewadi Road, Hadapsar, Pune, Maharashtra 411028
Department of Electronics and Telecommunication Engineering

Natural Language Toolkit (NLTK) is one of the leading Python platforms for processing language
data. It is a set of language processing libraries and programs that provide a toolkit for:
 Classification.
 Tokenization.
 Stemming.
 Tagging.
 Parsing.
 Semantic reasoning.
NLTK is a go-to tool for computational linguistics in Python. It's highly valued by linguists, engineers,
researchers, and industry users.
If you are new to natural language processing, you may benefit from the Working with Strings in Python
course, which is part of our interactive Python for Data Science track.
9. Pillow
If you work with image data, make sure to check out the Pillow package. It is a fork of PIL
(Python Image Library) that developed into an easy-to-use and efficient tool for image
manipulation in Python.
With Pillow, you can:
 Open and save images of different file types (JPEG, PNG, GIF, PDF, etc.).
 Create thumbnails for images.
 Use a collection of image filters (e.g. SMOOTH, BLUR, SHARPEN).
This is a great image manipulation tool for beginners, and it has fairly powerful image processing
capabilities.
10. pytest
This package provides a variety of modules for testing new code, including small unit tests and
complex functional tests for applications and libraries.
Simple syntax and an extensive feature set make pytest one of the most-loved Python packages among
programmers. This test automation framework provides:
 Built-in support for test discovery.
 Modular fixtures for test setup (e. g. setting up the database connection, URL, input data).
 Rich plugin architecture (315+ external plugins).
 Built-in unit tests.

Conclusion:
1. ____________________________________________________________________________
2. ____________________________________________________________________________
3. ____________________________________________________________________________
Questions :
1. Name a few libraries in Python used for Data Analysis and Scientific computations.
2. How are NumPy and SciPy related?
3. Which python library is used for Machine Learning?
4. A Python module is a file with the _____ file extension that contains valid Python code.
5. To use a module in another module, you must import it using an ________ statement.

SE [Electronics and Telecommunication]/2021-22 Subject: Data Analytics Lab


JSPM’s
Jayawantrao Sawant College of Engineering
Sr. No. 58, Handewadi Road, Hadapsar, Pune, Maharashtra 411028
Department of Electronics and Telecommunication Engineering

SE [Electronics and Telecommunication]/2021-22 Subject: Data Analytics Lab

You might also like