All Questions
8,278 questions
0
votes
0
answers
33
views
Can I create a list in a Scratch extension?
I'm developing a Scratch extension that will add some very useful features to the game. However, right now I'm trying to create a reporter that will split a string into a list at a certain character. ...
-5
votes
1
answer
53
views
Fastest and cleaner ways to insert, update, delete 2-dimensional array [duplicate]
I'm newbie in python language and have some prolem here. I have a list of name and score for example:
score = [['Andy', 80], ['John', 70], ['Diana', 100]]
I want to Delete or Update score based on it'...
0
votes
1
answer
35
views
React Native - updating a list rewrites data
So, in a tab, i'm displaying a list of Friends, when selecting one of the friends, the data should go to another list Participants.
Friends and Participants list
It works fine until you try to add ...
1
vote
2
answers
92
views
Pandas indexing
Can someone explain what is meant by
Both loc and iloc [in Pandas] are row-first, column-second. This is the opposite of what we do in native Python, which is column-first, row-second.
Because I ...
0
votes
8
answers
181
views
In Python, how can I replace a number from a numpy array with 2 others?
I'm trying to replace for example [1,2,3,4,5,6]
and replace the 4s and 6s with 2,2 and 2,3 respectively
thus returning [1,2,3,2,2,5,2,3]
Is there an efficient way to do this?
I tried with np.select to ...
-1
votes
1
answer
54
views
Generate and loop through pairs in a code block [duplicate]
I am trying to generate a list of unique pairs from two ranges. I then want to use this list of unique pairs as part of a URL in a loop to download a large batch of data.
I have managed to generate my ...
2
votes
3
answers
66
views
I would like to modify the values of specific elements in a list in an efficient manner [closed]
How can I make the function more efficient?
This is all the test code I wrote:
// ignore_for_file: public_member_api_docs, sort_constructors_first
import 'package:flutter_test/flutter_test.dart';
...
0
votes
1
answer
70
views
Creating a 'for' or 'if-else' selector for checking dynamically sized python List
I'm trying to mask 8752 images with transformers like this
from transformers import pipeline
from PIL import Image
import requests
import cv2
import numpy as np
from matplotlib import pyplot as plt
...
-1
votes
3
answers
169
views
Why isn't my method working for finding value of Fibonacci sequence for nth term?
I am trying to find the value of a Fibonacci sequence given an integer N, representing the nth term using an ArrayList (my logic is that because ArrayList are dynamic and can resize no matter what ...
2
votes
2
answers
73
views
How should I configure a pathfinding algororithim for my new level generation program
my problem is that I have a 2D array like this:
[["#", "#", "#", "#", "#", "#", "#", "#", "#", "#&...
-4
votes
1
answer
71
views
Making a List with Arithmetic Progression [duplicate]
[Doing an assignment where I have to have to run the formula a(n) = 2*n - 5 (n>=1)] 100 times and have those in a list so that I can grab terms and compare and bunch of other stuff. This is what my ...
0
votes
1
answer
15
views
Excel validate entries in list of lists
I have a master list of things (column A below), and I have a list of lists (column C below), where all sub-entries should exist in the master list. I would like to validate the list of lists (in ...
0
votes
1
answer
43
views
Batch-update adjacent elements in a Vec in Rust (for performance)
I'm building a little graphics library using minifb, essentially just drawing pixels to a framebuffer.
Currently, my code for blitting a rectangle to a Texture is as follows:
fn blit(&self, dest: &...
0
votes
2
answers
168
views
Why are arrays still in C# when we are actually always using List<T>? [closed]
I'm trying to figure out the reason behind the fact that, despite for any practical tasks we are always going to use List<T> in C#, vectors are still there in the langauge. I mean methods like ...
0
votes
1
answer
92
views
image from uint16 array from serial port [closed]
I'm getting values uint16 (RGB565) from serial port. The array contains 76800 uint16 values from an image 320x240. Right now I'm just sending the test bar image and I'm getting this image:
which it ...