Category "arrays"

Python find indices of subarrays which are continuous and increasing with difference of 1

The input is always strictly increasing. I could write this with a for loop and lots of if-else conditions, but is there some simple way? Here is an example: in

Attempting to use np.insert in a created class which has subscripts yields "object does not support item assignment" debug

I have defined my own class which takes in any matrix and is defined in such a way to convert this matrix into three numpy arrays inside a parenthesis (which I

Remove certain elements from an array that fit a condition in PHP?

So i have an a array of numbers: $arr = [53, 182, 435, 591, 637]; All i am trying to do is loop trough each element and when a certain condition is true it sho

Why the result of Exists function use == and != is not opposite? [closed]

string input = "1234"; string[] array = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" }; bool in_N1 = Array.Exists(array, x => x == i

Getting a stack overflow exception when declaring a large array

The following code is generating a stack overflow error for me int main(int argc, char* argv[]) { int sieve[2000000]; return 0; } How do I get around

Find the length of an array / comma separated string values in Quicksight Calculated Field

I have a column of sent_to_emails in my Quicksight Dataset. I want to calculate the number of values in this comma separated string i.e. split the string based

i want to add 2 data(may be 1) object in an array where array is a state of react

So here is my query, this is a small part of my code that is relevant to the question I want 3 input fields for different data input from users as in case the u

Click HREF to display specific Array Content?

Is it best if I use HREFs to display specific array content? Should I use a button instead? I am trying to filter and I am new to arrays and javascript, so I am

SpringBoot | Getting null after success response body when request with token

Returning a response in SpringBoot project like this: @GetMapping("/users") public ResponseEntity<List<UserDto>> getUsers() { return ResponseEnt

How to covert labels array into one vector of letters

I have the labels as the following: array([[1., 0., 0., 0.], [1., 0., 0., 0.], [1., 0., 0., 0.], ..., [1., 0., 0., 0.], [0., 0., 1., 0.], [0., 0., 0., 1.]], dty

If statements within a Query

I'm using a query & importrange combo like this: =IFERROR(QUERY(IMPORTRANGE("https://docs.google.com/spreadsheets/d/1EizWsVwZfUy1NDRwmmWEpj2OxTGvBjP9-YBbds9

Code exiting when Dynamic Array of class allocated

I am trying to dynamically allocate an array and whenever it gets to the part where it dynamically allocates the program exits. I would rather not use vectors a

How to create a for loop that reads each character in ksh

I'm unable to find any for loop syntax that works with ksh for me. I'm wanting to create a program that esentially will add up numbers that are assigned to lett

Array gives different values in main() and in a function() [closed]

I am trying to store a 1d array that stores random numbers into another 2d array. So as you can see, I am trying to store the passed random ar

App Script Array Push() in loop Optimization

I'm looking to improve my array push inside loops but I noticed that every time my function is being called (in a loop manner) and executing this lines of code,

Add array of objects as elements to existing table td

I have an existing table. I have the td cells displayed as blocks intentionally. :) My goal is to add labels inside each of the td's by creating spans with a sp

Split Datasets per labels

I want to split some datasets such as CIFAR10 or MNIST in a non-iid way: basically I am doing Federated Learning experiments, in which I want that each client h

Match variable value to array's index to get month

example of getDepart date format getDepart = 2022-04-29 desired result 29 APR, 2022 const getStringDepart = () => { const months = ["JAN", "FEB", "MA

I'm trying to make a function that takes a 2d array as a parameter and outputs a normal array containing every unique number, in java

The function needs to have a 2d array as a parameter and then return a normal array with all the unique numbers. If the 2d array is [ [1,1], [4,2] ] then it sh

C code collecting info through a function and passing it back, of datatype struct

//Program is to collect input from user so that can pass the array of inputs from the user to another print function but that are quite some Errors in the code