All Questions
7 questions
1
vote
1
answer
496
views
How should I approach the comparison of two BMP images?
I am currently writing a Python program that retrieves the pixels from two BMP files and finds the percent difference between them (without using the Pillow library for the purpose of learning). I can ...
-1
votes
2
answers
1k
views
How does a dynamic array access work?
In C if i declare
int x[4]
Which tells me its an integer array with each array element size fixed of size 4.
So after initialization when I access x[3] : address of array +element size which is 2 * ...
-2
votes
1
answer
1k
views
How to ask a user how many inputs they want
I want to know if it possible to use arrays for a more viable alternative of getting a non-predetermined number of inputs as an array and with an indefinite number of inputs. (python)
original code --...
3
votes
1
answer
276
views
Is it considered a bad practice to oversize an array so that negative indices behave well?
I have been practicing implementing some classic dynamic programming algorithms and was wondering if my implementation of the longest common subsequence search has a significant code smell.
In python,...
2
votes
1
answer
200
views
How to combine N non-comparable arrays up to an output limit in a fair way?
Given N non-comparable arrays of different sizes, what is the best method to combine them into one output array?
Since the input arrays are non-comparable, a metric is needed to represent how ...
85
votes
3
answers
44k
views
How do I move away from the “for-loop” school of thought?
This is a rather conceptual question, but I was hoping I could get some good advice on this. A lot of the programming I do is with (NumPy) arrays; I often have to match items in two or more arrays ...
6
votes
2
answers
5k
views
How to remove the boundary effects arising due to zero padding in scipy/numpy fft?
I have made a python code to smoothen a given signal using the Weierstrass transform, which is basically the convolution of a normalised gaussian with a signal.
The code is as follows:
#Importing ...