Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

python
machine learning
numpy

What is NumPy?

Educative Answers Team

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

NumPy is a free Python library equipped with a collection of complex mathematical operations suitable for processing statistical data. It can be imported into Python as follows:

import numpy as np
# The np label can be used to access the numpy library

Numerical data in machine learning

Data manipulation is a core component in data sciences and machine learning. In the case of machine learning, the system takes in a huge amount of data and trains itself to make accurate predictions. Naturally, it would need to perform arithmetic operations on numerical data to produce something meaningful. This is where NumPy comes into play.

Basic functions of NumPy

The main data structure in NumPy is the NumPy array. All the data is stored in arrays. NumPy provides a vast repertoire of mathematical and statistical operations which can be performed on these arrays.

svg viewer

Code

import numpy as np
arr_1 = np.array([1, 2, 3, 4, 5, 6])
fltr = [True, False, True, False, True, False]
# filtering elements of an array
arr_2 = arr_1[fltr]
print(arr_2)

RELATED TAGS

python
machine learning
numpy
Copyright ©2022 Educative, Inc. All rights reserved

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring