SlideShare a Scribd company logo
Data Analyzing
And
Visualization
Using Python
Prof. P. T. Chavan.
Sharad Institute of Technology, College of
Engineering Yadrav- (Ichalkaranji)
PYTHON LIBRARIES
FOR DATA
ANALYSIS
• Python is a general purpose language and is often used for
things other than data analysis and data science. What
makes Python extremely useful for working with data?
• There are libraries that give users the necessary
functionality when crunching data.(Data crunching is the
automated analysis of vast amounts of data
originating from Big Data.)
NUMPY 3
• Numpy stands for “Numeric Python” or “Numerical python”.
• Numpy is a package that contains several classes, functions,
variables etc. to deal with scientific calculations in Python.
• Numpy is useful to create and process single and multi-
dimensional arrays.
• In addition, numpy contains a large library of mathematics
like linear algebra functions.
ARRAY STRUCTURE IN NUMPY 4
5
INSTALLATION OF NUMPY
C:UsersYour Name>pip install numpy
If this command fails, then use a python
distribution that already has NumPy installed like,
Anaconda, Spyder etc.
Import NumPy
Following line of code is use to import numpy in the
python programme.
import numpy
or
import numpy as <<name>>
NUMPY 6
ExampleG
import numpy
arr = numpy.array([1, 2, 3, 4, 5])
print(arr)
TYPES OF ARRAY IN NUMPY
7
An array in numpy is of the following types
1. 1D Array
2. 2D Array
3. N-Dimension Array
1D ARRAY
One dimensional array contains elements only in one
dimension. In other words, the shape of the numpy array
should contain only one value in the tuple.
Example 1
import numpy
a = numpy.array([10,20,30,40,50])
print(a)
Output: [10,20,30,40,50]
TYPES OF ARRAY IN NUMPY
8
import numpy as np
a = np.array([10,20,30,40,50])
print(a)
Output: [10, 20, 30, 40, 50]
Note: if we use the following statement then there is no
need to add anything in front of array function.
from numpy import *
a = array([10, 20,30,40,50])
print(a)
Output : [10, 20,30,40,50]
IMPLEMENTATION OF 1D ARRAY IN NUMPY
9
Creating array in numpy can be done in several ways. Some of the
important ways are-
i. Using array() function
ii. Using linspace() function
iii. Using arange() function
iv. Using zeros() and ones() functions
1. USING ARRAY() FUNCTION
• Using this function we can create array of any data type, but if not data
types is mentioned the default data type will be the "int"
• For e.g :
from numpy import *
Arr=array([10,20,30,40,50],int) is similar to
arr = array([10,20,30,40,50])
• While creating array if one of the values in the specified list belongs to
float then all the values will be converted to float by default.
from numpy import *
a = array([10,30,40.5, 50,100])
print(a)
Output : = [10.0,30.0,40.5,50.0,100.0
2. LINSPACE() FUNCTION
3. ARANGE() FUNCTION 12
• The arange() function in numpy is same as range() function in
Python.
• The following format is used to create an array using the arange()
function.
• Syntax
 arange(start,stop,stepsize)
 arange(10) – will create an array with values [0,1,2,3,4,5,6,7,8,9]
 arange(5,10) – will create an array with values [5, 6,7,8,9]
 arange(10,1,-1) will create an array with
values[10,9,8,7,6,5,4,3,2]
Example
import numpy as np
a = np.arange(10)
b = np.arange(5,10)
c=np.arange(10,1,-1)
print(a)
print(b)
print(c)
Output-
[0,1,2,3,4,5,6,7,8,9]
[5,6,7,8,9]
[10, 9, 8, 7, 6, 5, 4, 3, 2]
THANK YOU

More Related Content

Similar to Data Analyzing And Visualization Using Python.pptx

Introduction to numpy.pptx
Introduction to numpy.pptxIntroduction to numpy.pptx
Introduction to numpy.pptx
ssuser0e701a
 
NumPy.pptx
NumPy.pptxNumPy.pptx
NumPy.pptx
EN1036VivekSingh
 
Intellectual technologies
Intellectual technologiesIntellectual technologies
Intellectual technologies
Polad Saruxanov
 
Python-Libraries,Numpy,Pandas,Matplotlib.pptx
Python-Libraries,Numpy,Pandas,Matplotlib.pptxPython-Libraries,Numpy,Pandas,Matplotlib.pptx
Python-Libraries,Numpy,Pandas,Matplotlib.pptx
anushya2915
 
L 5 Numpy final ppt kirti.pptx
L 5 Numpy final ppt kirti.pptxL 5 Numpy final ppt kirti.pptx
L 5 Numpy final ppt kirti.pptx
Kirti Verma
 
Introduction to Numpy, NumPy Arrays.pdf
Introduction to Numpy, NumPy  Arrays.pdfIntroduction to Numpy, NumPy  Arrays.pdf
Introduction to Numpy, NumPy Arrays.pdf
sumitt6_25730773
 
NumPy.pptx
NumPy.pptxNumPy.pptx
NumPy.pptx
DrJasmineBeulahG
 
NumPy.pptx
NumPy.pptxNumPy.pptx
NumPy.pptx
Paras Intotech
 
Demo1 use numpy
Demo1 use numpyDemo1 use numpy
Demo1 use numpy
Romaric Saounde Tsopnang
 
NumPy.pptx Bachelor of Computer Application
NumPy.pptx Bachelor of Computer ApplicationNumPy.pptx Bachelor of Computer Application
NumPy.pptx Bachelor of Computer Application
sharmavishal49202
 
Python
PythonPython
Scientific Python
Scientific PythonScientific Python
Scientific Python
Eueung Mulyana
 
Essential numpy before you start your Machine Learning journey in python.pdf
Essential numpy before you start your Machine Learning journey in python.pdfEssential numpy before you start your Machine Learning journey in python.pdf
Essential numpy before you start your Machine Learning journey in python.pdf
Smrati Kumar Katiyar
 
Standardizing arrays -- Microsoft Presentation
Standardizing arrays -- Microsoft PresentationStandardizing arrays -- Microsoft Presentation
Standardizing arrays -- Microsoft Presentation
Travis Oliphant
 
Matplotlib adalah pustaka plotting 2D Python yang menghasilkan gambar berkual...
Matplotlib adalah pustaka plotting 2D Python yang menghasilkan gambar berkual...Matplotlib adalah pustaka plotting 2D Python yang menghasilkan gambar berkual...
Matplotlib adalah pustaka plotting 2D Python yang menghasilkan gambar berkual...
HendraPurnama31
 
NumPy
NumPyNumPy
Q-Step_WS_06112019_Data_Analysis_and_visualisation_with_Python.pptx
Q-Step_WS_06112019_Data_Analysis_and_visualisation_with_Python.pptxQ-Step_WS_06112019_Data_Analysis_and_visualisation_with_Python.pptx
Q-Step_WS_06112019_Data_Analysis_and_visualisation_with_Python.pptx
kalai75
 
A Gentle Introduction to Coding ... with Python
A Gentle Introduction to Coding ... with PythonA Gentle Introduction to Coding ... with Python
A Gentle Introduction to Coding ... with Python
Tariq Rashid
 
Introduction to numpy
Introduction to numpyIntroduction to numpy
Introduction to numpy
Gaurav Aggarwal
 
Python - Numpy/Pandas/Matplot Machine Learning Libraries
Python - Numpy/Pandas/Matplot Machine Learning LibrariesPython - Numpy/Pandas/Matplot Machine Learning Libraries
Python - Numpy/Pandas/Matplot Machine Learning Libraries
Andrew Ferlitsch
 

Similar to Data Analyzing And Visualization Using Python.pptx (20)

Introduction to numpy.pptx
Introduction to numpy.pptxIntroduction to numpy.pptx
Introduction to numpy.pptx
 
NumPy.pptx
NumPy.pptxNumPy.pptx
NumPy.pptx
 
Intellectual technologies
Intellectual technologiesIntellectual technologies
Intellectual technologies
 
Python-Libraries,Numpy,Pandas,Matplotlib.pptx
Python-Libraries,Numpy,Pandas,Matplotlib.pptxPython-Libraries,Numpy,Pandas,Matplotlib.pptx
Python-Libraries,Numpy,Pandas,Matplotlib.pptx
 
L 5 Numpy final ppt kirti.pptx
L 5 Numpy final ppt kirti.pptxL 5 Numpy final ppt kirti.pptx
L 5 Numpy final ppt kirti.pptx
 
Introduction to Numpy, NumPy Arrays.pdf
Introduction to Numpy, NumPy  Arrays.pdfIntroduction to Numpy, NumPy  Arrays.pdf
Introduction to Numpy, NumPy Arrays.pdf
 
NumPy.pptx
NumPy.pptxNumPy.pptx
NumPy.pptx
 
NumPy.pptx
NumPy.pptxNumPy.pptx
NumPy.pptx
 
Demo1 use numpy
Demo1 use numpyDemo1 use numpy
Demo1 use numpy
 
NumPy.pptx Bachelor of Computer Application
NumPy.pptx Bachelor of Computer ApplicationNumPy.pptx Bachelor of Computer Application
NumPy.pptx Bachelor of Computer Application
 
Python
PythonPython
Python
 
Scientific Python
Scientific PythonScientific Python
Scientific Python
 
Essential numpy before you start your Machine Learning journey in python.pdf
Essential numpy before you start your Machine Learning journey in python.pdfEssential numpy before you start your Machine Learning journey in python.pdf
Essential numpy before you start your Machine Learning journey in python.pdf
 
Standardizing arrays -- Microsoft Presentation
Standardizing arrays -- Microsoft PresentationStandardizing arrays -- Microsoft Presentation
Standardizing arrays -- Microsoft Presentation
 
Matplotlib adalah pustaka plotting 2D Python yang menghasilkan gambar berkual...
Matplotlib adalah pustaka plotting 2D Python yang menghasilkan gambar berkual...Matplotlib adalah pustaka plotting 2D Python yang menghasilkan gambar berkual...
Matplotlib adalah pustaka plotting 2D Python yang menghasilkan gambar berkual...
 
NumPy
NumPyNumPy
NumPy
 
Q-Step_WS_06112019_Data_Analysis_and_visualisation_with_Python.pptx
Q-Step_WS_06112019_Data_Analysis_and_visualisation_with_Python.pptxQ-Step_WS_06112019_Data_Analysis_and_visualisation_with_Python.pptx
Q-Step_WS_06112019_Data_Analysis_and_visualisation_with_Python.pptx
 
A Gentle Introduction to Coding ... with Python
A Gentle Introduction to Coding ... with PythonA Gentle Introduction to Coding ... with Python
A Gentle Introduction to Coding ... with Python
 
Introduction to numpy
Introduction to numpyIntroduction to numpy
Introduction to numpy
 
Python - Numpy/Pandas/Matplot Machine Learning Libraries
Python - Numpy/Pandas/Matplot Machine Learning LibrariesPython - Numpy/Pandas/Matplot Machine Learning Libraries
Python - Numpy/Pandas/Matplot Machine Learning Libraries
 

Recently uploaded

哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
insn4465
 
The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.
sachin chaurasia
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
NidhalKahouli2
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
IJECEIAES
 
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptxML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
JamalHussainArman
 
TIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEM
TIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEMTIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEM
TIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEM
HODECEDSIET
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
MIGUELANGEL966976
 
Textile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdfTextile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdf
NazakatAliKhoso2
 
Question paper of renewable energy sources
Question paper of renewable energy sourcesQuestion paper of renewable energy sources
Question paper of renewable energy sources
mahammadsalmanmech
 
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
University of Maribor
 
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
ihlasbinance2003
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Christina Lin
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
Rahul
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
Yasser Mahgoub
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
IJECEIAES
 
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
171ticu
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
IJECEIAES
 
Computational Engineering IITH Presentation
Computational Engineering IITH PresentationComputational Engineering IITH Presentation
Computational Engineering IITH Presentation
co23btech11018
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
Hitesh Mohapatra
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
VICTOR MAESTRE RAMIREZ
 

Recently uploaded (20)

哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
 
The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
 
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptxML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
 
TIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEM
TIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEMTIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEM
TIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEM
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
 
Textile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdfTextile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdf
 
Question paper of renewable energy sources
Question paper of renewable energy sourcesQuestion paper of renewable energy sources
Question paper of renewable energy sources
 
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
 
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
 
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
 
Computational Engineering IITH Presentation
Computational Engineering IITH PresentationComputational Engineering IITH Presentation
Computational Engineering IITH Presentation
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
 

Data Analyzing And Visualization Using Python.pptx

  • 1. Data Analyzing And Visualization Using Python Prof. P. T. Chavan. Sharad Institute of Technology, College of Engineering Yadrav- (Ichalkaranji)
  • 2. PYTHON LIBRARIES FOR DATA ANALYSIS • Python is a general purpose language and is often used for things other than data analysis and data science. What makes Python extremely useful for working with data? • There are libraries that give users the necessary functionality when crunching data.(Data crunching is the automated analysis of vast amounts of data originating from Big Data.)
  • 3. NUMPY 3 • Numpy stands for “Numeric Python” or “Numerical python”. • Numpy is a package that contains several classes, functions, variables etc. to deal with scientific calculations in Python. • Numpy is useful to create and process single and multi- dimensional arrays. • In addition, numpy contains a large library of mathematics like linear algebra functions.
  • 5. 5 INSTALLATION OF NUMPY C:UsersYour Name>pip install numpy If this command fails, then use a python distribution that already has NumPy installed like, Anaconda, Spyder etc. Import NumPy Following line of code is use to import numpy in the python programme. import numpy or import numpy as <<name>>
  • 6. NUMPY 6 ExampleG import numpy arr = numpy.array([1, 2, 3, 4, 5]) print(arr)
  • 7. TYPES OF ARRAY IN NUMPY 7 An array in numpy is of the following types 1. 1D Array 2. 2D Array 3. N-Dimension Array 1D ARRAY One dimensional array contains elements only in one dimension. In other words, the shape of the numpy array should contain only one value in the tuple. Example 1 import numpy a = numpy.array([10,20,30,40,50]) print(a) Output: [10,20,30,40,50]
  • 8. TYPES OF ARRAY IN NUMPY 8 import numpy as np a = np.array([10,20,30,40,50]) print(a) Output: [10, 20, 30, 40, 50] Note: if we use the following statement then there is no need to add anything in front of array function. from numpy import * a = array([10, 20,30,40,50]) print(a) Output : [10, 20,30,40,50]
  • 9. IMPLEMENTATION OF 1D ARRAY IN NUMPY 9 Creating array in numpy can be done in several ways. Some of the important ways are- i. Using array() function ii. Using linspace() function iii. Using arange() function iv. Using zeros() and ones() functions
  • 10. 1. USING ARRAY() FUNCTION • Using this function we can create array of any data type, but if not data types is mentioned the default data type will be the "int" • For e.g : from numpy import * Arr=array([10,20,30,40,50],int) is similar to arr = array([10,20,30,40,50]) • While creating array if one of the values in the specified list belongs to float then all the values will be converted to float by default. from numpy import * a = array([10,30,40.5, 50,100]) print(a) Output : = [10.0,30.0,40.5,50.0,100.0
  • 12. 3. ARANGE() FUNCTION 12 • The arange() function in numpy is same as range() function in Python. • The following format is used to create an array using the arange() function. • Syntax  arange(start,stop,stepsize)  arange(10) – will create an array with values [0,1,2,3,4,5,6,7,8,9]  arange(5,10) – will create an array with values [5, 6,7,8,9]  arange(10,1,-1) will create an array with values[10,9,8,7,6,5,4,3,2] Example import numpy as np a = np.arange(10) b = np.arange(5,10) c=np.arange(10,1,-1) print(a) print(b) print(c) Output- [0,1,2,3,4,5,6,7,8,9] [5,6,7,8,9] [10, 9, 8, 7, 6, 5, 4, 3, 2]