Category: New Python tutorial

python tutorials and learn python

Created with Sketch.

NumPy copy()

NumPy copy() Summary: in this tutorial, you’ll learn how to use the NumPy copy() method to create a copy of an array rather than a view. Introduction to the NumPy copy() method When you slice an array, you get a subarray. The subarray is a view of the original array. In other words, if you…
Read more

Boolean Indexing

Boolean Indexing Summary: in this tutorial, you’ll learn how to access elements of a numpy array using boolean indexing. Introduction to numpy array boolean indexing Numpy allows you to use an array of boolean values as an index of another array. Each element of the boolean array indicates whether or not to select the elements…
Read more

Fancy Indexing

Fancy Indexing Summary: in this tutorial, you’ll learn about the fancy indexing technique to select elements of a numpy array. Introduction to fancy indexing In the previous tutorial, you learned how to select elements from a numpy array using indexing and slicing techniques. Besides using indexing & slicing, NumPy provides you with a convenient way…
Read more

Numpy Array Slicing

Numpy Array Slicing Summary: in this tutorial, you’ll learn about the numpy array slicing that extracts one or more elements from a numpy array. Numpy array slicing on on-dimensional arrays NumPy arrays use brackets [] and : notations for slicing like lists. By using slices, you can select a range of elements in an array…
Read more

NumPy Array Indexing

NumPy Array Indexing Summary: in this tutorial, you’ll learn how to access elements of a numpy array using indices. Like a list, you can use the square bracket notation ([]) to access elements of a numpy array. NumPy array indexing on 1-D arrays Along a single axis, you can select elements using indices. The first…
Read more

NumPy linspace()

NumPy linspace() Summary: in this tutorial, you’ll learn how to use the numpy linspace() to create a new numpy array with evenly spaced numbers of a specified interval. Introduction to the numpy linspace() function The numpy linspace() function creates a new numpy array with evenly spaced numbers over a given interval: numpy.linspace(start, stop, num=50, endpoint=True,…
Read more

NumPy arange()

NumPy arange() Summary: in this tutorial, you’ll learn how to use the numpy arange() function to create a numpy array with evenly spaced numbers. Introduction to the numpy arange() function The numpy arange() function creates a new numpy array with evenly spaced numbers between start (inclusive) and stop (exclusive) with a given step: numpy.arange(start, stop,…
Read more

NumPy ones()

NumPy ones() Summary: in this tutorial, you’ll learn how to use the numpy ones() function to create a numpy array of a given shape whose elements are filled with ones. The ones() function of the numpy module allows you to create a numpy array of a given shape whose elements are filled with ones. For…
Read more

NumPy zeros()

NumPy zeros() Summary: in this tutorial, you’ll learn how to create a numpy array of a given shape whose elements are filled with zeros. The zeros() function of the numpy module allows you to create a numpy array of a given shape whose elements are filled with zeros. For example, the following uses the zeros()…
Read more

Create NumPy Array

Create NumPy Array Summary: in this tutorial, you’ll learn how to create NumPy arrays including one-dimensional, two-dimensional, and three-dimensional arrays. The array is the core data structure of the NumPy library. A NumPy array is a grid of values with the same type and indexed by a tuple of non-negative integers. All arrays are instances…
Read more