Category "arrays"

How to convert all string in Dart list to lowercase?

I want check if Dart list contain string with list.contains so must convert string in array to lowercase first. How to convert all string in list to lowercase?

The dimension orders of the Numpy 3D array are designed to z, x, y. Are there any advantages?

I think that the x,y,z order is more intuitive for a 3D array, just as Matlab does. For example, If someone tells me an array is 2x3x4, I will think it is 2 row

how to Save Inputted Values ​from Edittext into Array?

I am making a program to get Values ​​from edittext and store it in an array then I want to display that array on screen and here is my command Edi

searching multiple Object Value in another Object JavaScript

I have 2 array of object in that, I want to compare all of the first array object property and value present in the second array of object. (at the object level

searching multiple Object Value in another Object JavaScript

I have 2 array of object in that, I want to compare all of the first array object property and value present in the second array of object. (at the object level

Moving PostgreSQL bigint array unique value to another index

How can I move the array bigint value from one index to another? For example, I have an array ARRAY[1, 2, 3, 4] of bigint unique values and want to move value 1

Given an array of integers, find the pair of adjacent elements that has the largest product and return that product

Given an array of integers, find the pair of adjacent elements that has the largest product and return that product. and here is my code function adjacentEle

Swift 4 - How to return a count of duplicate values from an array? [duplicate]

I have an array with multiple values (Doubles), many of which are duplicates. I'd like to return or print a list of all unique values, along

How to limit properties of a JSON object given array of property names using JQ?

Assuming I have the following JSON object (which is just an example): { "foo": 1, "bar": 2, "baz": 3 } And the following JSON array (another example)

PHP: set a (deep) array key from an array [closed]

is there a PHP function that would create a (deep) array key from an array ? It's quite difficult to explain, see that example: function myst

"Notice: Undefined variable", "Notice: Undefined index", "Warning: Undefined array key", and "Notice: Undefined offset" using PHP

I'm running a PHP script and continue to receive errors like: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php on line 10 Notice: U

Better way to modify values in a single array to different format

This may be a duplicate question. But I didn't find any similar questions in this forum. I'm trying to modify values in an array to different format. arrayInput

Finding number of inversions in given array

I have written the following code to find the inversions in array {1,4,2,5,3} by using merge sort technique. I have been debugging it to the best of my knoledge

Pythonic way to get both diagonals passing through a matrix entry (i,j)

What is the Pythonic way to get a list of diagonal elements in a matrix passing through entry (i,j)? For e.g., given a matrix like: [1 2 3 4 5] [6 7 8

Julia: how to index an 'any' type array

I am new in Julia. I want to replicate the results in Wollmann (2019). However, it always give me this error: LoadError: MethodError: no method matching setinde

int cannot be converted to int []

new to programming here and i keep getting the error message, incompatible types, int cannot be converted to int [], the question is to add R1 & R2 together

Fastest way in numpy to get distance of product of n pairs in array

I have N number of points, for example: A = [2, 3] B = [3, 4] C = [3, 3] . . . And they're in an array like so: arr = np.array([[2, 3], [3, 4], [3, 3]]) I nee

How do I group values to an array for the same field value in jq?

I have json data that looks like [ { "session": "ffe887f3f150", "src_ip": "81.71.87.156" }, { "session": "fff42102e329", "src_ip": "143.19

How can I correctly display all the elements of 2D array that have even neighbors?

I wrote a program that finds and displays all the elements in the 2D array, which have all neighbors(left, top, right, bottom) - even. I tried to put in an if,

Cleanest way to wrap array index?

Say I have an array of 5 Ints. What would be the most efficient way to wrap the index of the array if the index were incremented or decremented (for example) th