Skip to main content

All Questions

3votes
1answer
136views

Create a forecast matrix from time series samples

I would like to create a matrix of delay from a time series. For example, given y = [y_0, y_1, y_2, ..., y_N] and W = 5 I need to create this matrix: ...
graille's user avatar
-2votes
1answer
162views

Adding 1 million combinations of numbers to a file

The code adds approximately 1,720,000 different combinations of numbers to a file, some_other_file.txt. The numbers range from 2 digits long to 16 digits long. I ...
Hackernoob666's user avatar
0votes
1answer
87views

Optimise python functions for speed

Any one can help me optimise those three functions? I did profiling and timing of my original python file and found that most calls and time duration was because of those three functions. The three ...
mehio hatab's user avatar
2votes
1answer
229views

Further Optimizing a Segmented Sieve of Eratosthenes

I've implemented a Segmented Sieve of Eratosthenes that assumes each segment is about length \$ \sqrt{N}\$ for some upper limit \$N\$. I further optimized the function by skipping all the evens when ...
daOnlyBG's user avatar
5votes
1answer
664views

Bank account balance program

Would my code be considered fairly optimal and efficient? If not, where can I look to improve the code? The program works just fine. Would this method scale well if the dictionary containing the ...
Samuel Lee's user avatar
1vote
1answer
4kviews

Clustering using k-medoids

This is the program function code for clustering using k-medoids ...
dodo's user avatar
8votes
2answers
373views

Maximize a traveling employee's vacation over k weeks

I have following problem statement A lazy employee works at a multi-national corporation with N offices spread across the globe. They want to work as few days over k weeks as possible. Their company ...
Rohit's user avatar
  • 1,076
6votes
1answer
95views

Build embedded XML based on string containment

I have a list of strings that represent a path. These are unique, unsorted values that look like this: ...
Bram Vanroy's user avatar
4votes
0answers
1kviews

Memory optimization when finding the Cartesian product in Python

My function gets the Cartesian product of a list of lists of tuples. The function is correctly producing the list of lists, but it's a memory hog (and leads to a MemoryError for large data sets, with ...
jda's user avatar
  • 141

close