# multidimensional-array

## Cutting an array into consistent pieces of any size, with recursion

Cutting an array into consistent pieces of any size, with recursion Question: The problem is to, given an array, write a generator function that will yield all combinations of cutting the array into consistent pieces(arrays of elements that are consecutive in the given array) of any size and which together make up the whole given …

## To iterate through a .txt table in python

To iterate through a .txt table in python Question: Student ID, Assignment, Score 123456, Zany Text, 100 123456, Magic 9 Ball, 60 123456, Nim Grab, 80 123456, Dungeon Crawl, 78 123456, Ultimate TODO List, 90 654321, Zany Text, 48 This is the content of the .txt file, I need to iterate through this text and …

## Computing the mean of an array considering only some indices

Computing the mean of an array considering only some indices Question: I have two 2d arrays, one containing float values, one containing bool. I want to create an array containing the mean values of the first matrix for each column considering only the values corresponding to False in the second matrix. For example: A = …

## How to use numpy.arange with two other arrays as the start and stop parameter?

How to use numpy.arange with two other arrays as the start and stop parameter? Question: I want to build a 2D-array where the first dimension has the same length as two other arrays and the second dimension is an array created by numpy.arange and based on every element of the other two arrays, where one …

## How to reverse the elements in numpy.ndarray Python

How to reverse the elements in numpy.ndarray Python Question: I have a numpy.ndarray in Python has the following elements e.g[[-0.85] [ 0.95]]. How can I reverse it so it can be [ [ 0.95][-0.85]]. Keep in mind that the length always two but for sure the values are changing. <class ‘numpy.ndarray’> [[-0.85] [ 0.95]] Asked …

## Changing the value of values after a particular index along one axis in a 3D numpy array

Changing the value of values after a particular index along one axis in a 3D numpy array Question: I have a 3d array of format given below. The below is the one sample of the 3D array, like it , it contain more than 1000. sample shape of the 3D array is (1000 x 10 …

## Using an Input to Retrieve a Corresponding Element From a 2D Array

Using an Input to Retrieve a Corresponding Element From a 2D Array Question: This might be a really obvious solution to some, but, being pretty new to python, I’m unsure how to do it – In short, I want to take a user’s input, and find the corresponding element on a 2D array, i.e. an …

## How to get key filtered by its value in multidimensional array Python

How to get key filtered by its value in multidimensional array Python Question: I got this data employee_detail_list = { ‘John Doe’: { ‘name’: ‘EMP-0001’, ‘first_name’: ‘John’, ‘last_name’: ‘Doe’, ‘full_name’: ‘John Doe’, ‘company’: ‘Company 1’ }, ‘Tom Smith’: { ‘name’: ‘EMP-0002’, ‘first_name’: ‘Tom’, ‘last_name’: ‘Smith’, ‘full_name’: ‘Tom Smith’, ‘company’: ‘Company 2’ }, ‘Andrew Sebastian’: { …