All Questions
2,331 questions
0
votes
2
answers
81
views
Processing satellite conjunctions with numpy efficiently
Original Post: How to populate a 2-d numpy array with values from a third dimension?
New Post:
I'm trying to analyze interference between satellites using numpy and sgp4 python libraries, and want to ...
4
votes
1
answer
70
views
Numpy Structured Array - Memory copy error
I am using python structured arrays to arrange relevant data then passing it into C++ land. I noticed on occasion a memory copy error which leads to calculation issues. I first explored using hashing ...
0
votes
1
answer
54
views
Fixing logic toplace consecutive elements in a List Table Column
I need to create a Python program that places highest_priority_order = "Order B" into schedule_table following this logic:
It means that I need to add 2 consecutive hours in the "...
0
votes
0
answers
39
views
How to take only the values of the array and not the entire array? [duplicate]
x = [1, 2, 3]
y = x
y.append(4)
print(x)
This code will return [1, 2, 3, 4] but I want only [1, 2, 3].
This works like I want it to:
x = [1, 2, 3]
y = []
y[0] = x[0]
y[1] = x[1]
y[2] = x[2]
# Or use ...
-1
votes
2
answers
107
views
Why does this not print hello at the end but instead the letters are all scrambled
Im tying to create a effect that make the string "hello" gradually appear:
import time
text = "hello"
alphebet = [
"a", "b", "c", "d", &...
-4
votes
1
answer
60
views
How to generate an array so that it does not change? [closed]
How to generate a list that will not change until I want it to?
random.sample(range(1, 15), 14)
every time the program is launched, a new list will be generated, how can I make it so that it does not ...
-1
votes
2
answers
62
views
issue while updating python array [duplicate]
new = [{'n': '1234', 'indicator': 'RSI'}, {'n': '1234', 'indicator': 'RSI'}, {'n': '1234', 'indicator': 'RSI'}, {'n': '1234', 'indicator': 'RSI'}]
I am trying to update the above array 0 element only ...
0
votes
0
answers
27
views
Aligning Sparse Boolean Arrays
I have two (very) long and sparse boolean arrays n1 and n2, representing spikes of two neurons that are responding to the same stimulus. Because they are responding to the same stimulus, they have ...
0
votes
2
answers
74
views
dynamic programming: (minimum days of not eating icecreams)
Minimum Days Not Eating Ice-cream
Ram decides to eat ice-cream for N days. On each day the ice-cream shop can have chocolate flavour or mango flavour or both or none. The availability of ice-cream ...
0
votes
1
answer
45
views
Extract data from array Python (spotify API)
Fairly simple question.
How to extract the spotify:artist: values from this return data?
[{'external_urls': {'spotify': 'https://open.spotify.com/artist/4RB42AM4VqzdHRQiVbzDU1'}, 'href': 'https://api....
0
votes
1
answer
41
views
Why are my numpy array elements being cast to lists?
import numpy as np
ar1 = np.array([[[1,2,3],[4,5,6]],[[1,2,3],[4,5,6]]])
ar2 = np.array([[[1,2,3],[4,5,6]],[[1,2,3,4],[4,5,6,7]]])
print(ar1)
print(ar2)
When I run this the second array prints out ...
0
votes
0
answers
109
views
Python read a csv file and map it to an object directly
I am trying to parse some data for my project.
I have following structure:
class Subject:
#listing the fields only
subject_name
grade
prof_name
details
(few more )
...
1
vote
1
answer
90
views
Build a circuit taking a starting box and trying to search, horizontally and vertically, for other boxes that are not None within a matrix
from random import shuffle
matrix_aux_with_num_decompositions = [
[None, 'b', None, 100, 100, -3],
[None, None, 200, 'a', None, 100],
[ 100, 200, None, None, None, None],
]
...
1
vote
1
answer
66
views
Decomposing Matrix Values into Two Numbers in a Specified Manner
Having this matrix I want to decompose the numerical values (those that are not None), in this case 6, 9, 9, 3, 5, and 4 into 2 numbers that added together give those numbers.
matrix_aux = [
[None, ...
1
vote
3
answers
94
views
Update every nth element of given a range
I have N=12
and between 1 to 12 (in N) I want every 3 elements to be updated.
For example:
I am calculating the current hour(say 6am) and add 4 hours to start with "6-10" for the 1st 3 rows ...