Category "arrays"

add Array using for loop (JS)

I'm recreating a hangman game where I create a random word and conceal this with "". i.e if the word is "monkey" then the array should be ["", "", "", "", "", "

Stack the same row in each layer of a 3D numpy array

Hi is there a way to efficiently stack the same row in each layer of a 3D numpy array? I have an array like this: a = np.array([[["a111","a112","a113"],

Could you share with me information about [...] in Dart?

I've solved several solutions on Codewars and saw that one solution uses [...], I tried to google what it is, but google only finds how to create arrays (List a

Adding a value to a range of values in an array in Python without using a for loop

I'm trying to learn Python and I have run into a problem. I am attempting to complete the Array Manipulation challenge on hackerrank. A part of solving it requi

PHP foreach loop on unknown depth multidimensional array

I have a multidimensional array consisting of a directory structure or a tree if you want, but how can I loop through this data when I don't know the depth of t

I am trying to add an object to the end of an array inside said object

I have some code that creates a bunch of Creatures(cells) and they move around the screen and eat food. They all have an age variable so once they become a cert

Deleting node in list

*x = L->list[i]; /* Save the deleted element to parameter x */ for(j = i+1; j <= L->size-1; j++) L->list[i] = L->list[i+1]; L->size--;

save map bookmark for each user login using .net and javascript

I want to create Bookmark widget, and I want each user can save his own bookmarks. and when login to the application can see only his bookmarks. for this I have

Javascript - Giving alert for string input but number

Hi recently I was writing a code which basically askes users to input a cost for any item. The item name or price are not important so far. How the system works

function which tells whether an array is subsequence of another but 1 of the loop isnt working

def is_subsequence_array(array, sequence): for num in sequence: if array.count(num) != 1 : output = False for i in range(len(sequence) - 1

How can I select a selected item from one array from another? AngularJS

Please help, I don't understand how I can select a selected item if it comes from somewhere else and is in a different array. If this is not possible, is it pos

Spark-Java : How to add an array column in spark Dataframe

I am trying to add a new column to my Spark Dataframe. New column added will be of a size based on a variable (say salt) post which I will use that column to ex

'TypeError: Cannot set properties of undefined (setting '0')'----Array assignment

When I was solving a problem on Leetcode, I've defined an empty array. I tried push some numbers then I got this Error. I don't know why. My code here.

How to change array rows places whithouth numpy

Hello everyone here is my code: n =[[34,2,55,24,22],[31,22,4,7,333],[87,74,44,12,48]] for r in n: for c in r: print(c,end = " ") print() sums=[]

Cryptographically secure pseudo random shuffle a list or array in python

I am in need of a shuffle function that uses CSPRNG (Cryptographically Secure Pseudo Random Number Generator) and can be seeded manually for the same output for

Use Wildcards in Replace Function in combination with 2D Array Values

I'm trying to go through a list with two columns and replace some of the text in the second column. I want to search for values using wildcards in combination w

concatenate arrays of different lengths into one multidimensional array

I know that you cant stack or concatenate arrays of different lenghths in NumPy as all matrices need to be rectangular, but is there any other way to achieve th

Using qsort to sort a multidimensional array of variable-length strings in C

I have a piece of software that generates a rather large text file full of information about files in a directory. There are often several thousand files. Each

how to fetch specific number of rows (6 rows) from database and get average of those values , then output average to an integer [duplicate]

i am creating php script to take input from a data base containing [id,value,date] , there are many rows (increasing every minute using an api

How can I explicitly assign a receiving variable to be an array

ok, so, I was doing this before and its working: let array = []; if (blablabla) array = ["foo","bar"]; else array = ["this", "that"]; FunctionImUsing(array) An