# Varun

## Convert 2D NumPy array to list of lists in python

In this article, we will learn how to convert 2D Numpy Array to a nested list i.e. list of lists. Convert 2D Numpy Array to list of lists using tolist() In Python’s numpy module, the ndarray class provides a member function tolist(), which returns a list containing the copy of elements in the numpy array. …

## Convert NumPy array to list in python

In this article we will discuss how to convert a 1D or 2D or 3D Numpy Array to a list or list of lists. Table of Contents Convert a Numpy Array to a List Convert 2D Numpy array to list of lists Convert 2D Numpy array to a flat list Convert 3D Numpy array to …

## np.ones() – Create 1D / 2D Numpy Array filled with ones (1’s)

In this article, we will discuss how to create 1D or 2D numpy arrays filled with ones (1s). numpy.ones() Python’s Numpy module provides a function to create a numpy array of given shape & type and filled with 1’s i.e, Arguments: shape: Shape of the numpy array. Single integer or sequence of integers. dtype: (Optional) …

## np.zeros() – Create Numpy Arrays of zeros (0s)

In this article, we will discuss how to create 1D or 2D numpy arrays filled with zeros (0s). numpy.zeros() Python’s Numpy module provides a function to create a numpy array of given shape & type and filled with 0’s i.e, Arguments: shape: Shape of the numpy array. Single integer or sequence of integers. dtype: (Optional) …

## C++: Convert Vector to Set ( 5 Ways )

In this article, we will discuss different ways to convert a vector into a set in C++. Convert a Vector to a Set in C++ using Range Based Constructor In C++, set class provides a constructor which accepts a range i.e. [start, end). It creates a set from all the element in the given range …

## C++: Convert Set to Vector

In this article, we will discuss different ways to convert a set into a vector in C++. Convert a Set into a Vector in C++ using Range Based Constructor In C++. vector class provides a constructor which accepts a range i.e. [start, end). It creates a vector from all the element in the given range …

## C++: Convert vector to array (4 Ways)

In this article we will discuss different ways to convert a vector into an array in C++. Convert a vector into an array by copying items one by one Suppose we have a vector of N integers and we want to create an array from it. For that first we need to create a n …

## Linux: Create directory or folder using mkdir command

In this article we will discuss how to create a single or multiple directories in Linux using mkdir command. Then we will see various examples like, creating folders with space in name or creating folders with different permissions or creating nested directories recursively in single command. Table of Contents mkdir command – Introduction Create a …

## C++: Convert Array to Vector (7 Ways)

In this article, we will discuss different ways to convert an array to a vector in C++.

## C++: Test / Check if a value exist in Vector

In this article, we will discuss different ways to check if a vector contains an element or not. Table of Contents C++: Check if an item exits in vector using find(). C++: Check if item exits in vector using range based for loop. C++: Check if item exits in vector and get index position. C++: …

Scroll to Top