Category "arrays"

How to make a array inside array?

I have this two array. I want to make a array inside an array like this. How can I achieve that. Code posted below. This is the image I am sending inside fileTo

How to convert array of objects into custom grouped array

I am trying to convert the data object to custom format This is my data which i want to convert [ { Name: 15, GroupID: 1, Id: 1 }, { Name: 16, GroupID: 1,

How to vectorize such an algorithm in python?

I have four (nx1) dimensional arrays named a, b, c, and F. I want to run this algorithm without any loops. for i in range(n): if a[i] < b[i]: F[i

how to find possible combinations

I have an array of 16 columns and 22 rows. please advice how to find all possible combinations with the following rules: I can't choose more than 1 value per ro

Is there a more functional way to merge and foreach/sort two arrays in TypeScript, React?

I'm learning React and TypeScript. For sake of practise, I've tried to create a calculator design by merging two arrays to map a single array onto the grid (dis

JavaScript sorting of an RGB array

This is the task: Colors have to be ordered in such way: Higher Red value first; if the same then: Higher Green value first; if the same then: Higher Blue val

How to post an image file with a list of strings using FastAPI?

I have tried a lot of things, but it doesn't seem to work. Here is my code: @app.post("/my-endpoint") async def my_func( languages: List[str] = ["en", "hi"]

How to sort a array with a function and using a code like this in java

Hello i have a java Code where i the Programm should sort the variable num but it only gives out some weird strings. I would like if you could help my with some

How to split input text file that has string and doubles?

I am to read from an .txt input and sort into array by line (read: first name, last name, grade1, grade 2, grade3) but I am having issues. I am assuming that I

How do I take the repeated values in an array and print out the number of duplicates using a for loop ?(Java)

I have written the following program which takes the duplicates in the doubleArray and adds them to a counter. Then I wrote a for loop to print out the values i

Update a dynamic created JS html table after a row is deleted

I have an HTML table dynamically created via JavaScript. After filling in some fields, clicking the "Add" button adds a new row to the table. After inserting a

How to save JSON parsing values to an array in ArduinoJson

Arduino users, help pls! Hi guys! For example, I have a JSON document for parsing ArduinoJson: { "id": [ 1, 7, 32, 9656 ] } I need to save

Change of behavior of a function to compute multiple numpy arrays mean

I have three BGR color values (stored into numpy arrays) and I want to compute their mean value (of each element, as to have a numpy array looking like this : [

How to use Image Literal in the latest Xcode version 13?

I have tried the #imageliteral method but it seems to not working also. I need to use many images in an array so is there any alternative to it or not?

Properly filter names on an array in java

so I have this data on an array and I need to only appear [ {apellido_paterno:"algo",nombre: "jose"} ] in the output but its showing all 3 of the objects let da

PostgreSQL 12.2 with Sequelize 6.3 - UPSERT a array of data and want ON CONFLIT DO UPDATE to merge current existing JSONB and EXCLUDED JSONB

I'm currently using this query to insert or update my array of data when retrieving my list : try { const query = `INSERT INTO "Tables" ("id","tomerge

How can I avoid ArrayIndexOutOfBoundsException or IndexOutOfBoundsException? [duplicate]

If your question is I am getting a java.lang.ArrayIndexOutOfBoundsException in my code and I do not understand why it is happening, what does

Problem to integrate a function with multiple array in python

I work on a Python Script and I need to integrate a very long function. The function contains several array and I don't succeed to integrate it. I need to integ

How do I add bits to a MemoryStream

So I've been trying to add bits of a value to a MemoryStream but the issue is I have no idea how. I've seen that it's used for performance when it comes to netw

Remove duplicate entries from string array column of postgres

I have a PostgreSQL table where there is column which has array of strings. The row have some unique array strings or some have duplicate strings also. I want t