Multiple matrix multiplication

In numpy, I have an array of N 3x3 matrices. This would be an example of how I'm storing them (I'm abstracting away the contents): N = 10 matrices = np.ones((N, 3, 3)) I also have an array of 3-vectors, this would be an example: vectors = np.ones...
more »

2017-01-10 23:01 (1) Answers

Oracle SQL Index DATE vs Index TRUNC(DATE)

I have a Table named DEXTRACTO and I need to consult a period of time based on column F_EXTRACTO (witch is DATE format) with a BETWEEN DATE1 AND DATE2 condition (DATE1 and DATE2 can change). Here's some data of the table: SQL> SELECT MIN(F_EXTRAC...
more »

2017-01-09 17:01 (2) Answers

Speed up Pandas cummin/cummax

Pandas cummin and cummax functions seem to be really slow for my use case with many groups. How can I speed them up? Update import pandas as pd import numpy as np from collections import defaultdict def cummax(g, v): df1 = pd.DataFrame(g, col...
more »

2017-01-07 21:01 (2) Answers

Haskell: Data.Text vs. Data.Text.Lazy Performance

for training i wrote a short Haskell program as a replacement for a Perl script. The program reads a log file which contains multi-line messages and simply joins them to produce one line per message. My test input file has 14000 lines and a size of 1...
more »

2017-01-06 09:01 (2) Answers

pandas dataframe filtering row like groupby

for example, I have a dataframe with these 2 columns a, and b: a = [1,1,1,1,1,1,1,2,2,2,2,2,2,2,3,3,3,3,3,3,3] b = [1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1] I am expecting filtered dataframe: [5,6,7,2,3,4,9,0,1] Without using the groupby functi...
more »

2017-01-04 15:01 (2) Answers

Using the ID attribute in html leaves slow?

I am automating a web application using selenium, this application does not have the ID attribute in tags html, in some cases nor the name. The reason for not using ID is that it slows down the system, I wonder if this is myth or truth. ...
more »

2017-01-04 13:01 (0) Answers

Copying big amount of data in VBA excel

I would like to be able to copy around 30k rows (to be exact, just some elements of the rows) from sheet A to sheet B, starting the destination from row nr 36155. Sometimes, we copy the row more than once, depending on the number in the G column. Thi...
more »

2017-01-02 11:01 (2) Answers

Python function performance

I have 130 lines of code in which part except from line 79 to 89 work fine like compiles in ~0.16 seconds however after adding function which is 10 lines(between 79-89) it works in 70-75 seconds. In that function the data file(u.data) is 100000 line...
more »

2017-01-02 04:01 (2) Answers

How to optimize data generation for numpy call

I'd like to know how to make the following code shorter and/or more efficient. Could I (or should I) get rid of the for loop by using a functional method, or is there method I should be using from numpy? The code calculates the expected value o...
more »

2017-01-01 20:01 (2) Answers

Java List Horrible Adding Performance

I'm adding millions of entries of a custom object to a List. This turns out to be very slow and the graphical user interface keeps freezing randomly as well (not responding on Windows) even though the adding operation is wrapped in a SwingWorker so i...
more »

2016-12-31 21:12 (1) Answers

Pandas search speed/performance/efficiency

ID outcome Source_doc 23145 A ARR 23145 A CRE 23145 B ARR 23145 C CRE 23456 B ARR 23456 B CRE ID #145 from ARR has [A,B] outcomes. ID #145 from CRE has [A,C] outcomes. Below you can see I would then place ID #145 in the 'no...
more »

2016-12-28 18:12 (2) Answers

Speed up for loop in numpy

I am looking for accelerating this loop in numpy but I find no obvious pattern to do so: for index1 in range(1, len_route): time_diff_matrix[index1, (index1+1):len_route] = \ M[(index1-1):(len_route-2)] - \ M[index1-1...
more »

2016-12-27 14:12 (1) Answers