Category "arrays"

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

When one of my column in dataframe is nested list, how should i transform it to multi-dimensional np.array?

I have the following data frame. test = { "a": [[[1,2],[3,4]],[[1,2],[3,4]]], "b": [[[1,2],[3,6]],[[1,2],[3,4]]] } df = pd.DataFrame(test) df a b 0

Create a new array of boolean values by comparing two arrays with objects

I have a question about creating JavaScript arrays. Here's what I want to do. I have two arrays. Each array has object(s) in them. The first array has exactly 5

C# Saving list box items to Array upon button click

On a second form, I have 4 text boxes that when button click "ADD", items add to a single list box in this format Airport 1 Runway 1 Runway 2

Trying to separate sql DB values from each other

function absent() { const absent_date = new Date(); const absent_days = absent_date.getDay(); console.log("days", absent_days); let absent_remo

Unrecognized option 'stimeout'

Unrecognized option 'stimeout', is popping up when i'm using the command: ffmpeg -re -rtsp_transport tcp -y -stimeout 1000000 -i "rtsp://admin:[email protected]

Jquery Object and Array implementation

I have an Object let data = { a: 1, b: 2, c: { abc: "ak", bcd: "gh", cfv: "ht" } } the

Does i = x[i]++; lead to undefined behavior?

Can someone please explain whether i = x[i]++; lead to undefined behavior? Note: x[i] and i are not both volatile and x[i] does not overlap i. There is C11, 6.5

Can't get values past array[0] to translate properly

Okay, to start with I should mention this is a very small personal project, and I've only have a handful of coding classes several years ago now. I can figure o

Spreading an array inside an object gives unexpected result - Javascript

I have two arrays of objects with the same keys and I want to combine them and create a new array of objects. I am able to get almost everything right, but the