Skip to content
Advertisement

Tag: performance

Why is this task faster in Python than Julia?

I ran the following code in RStudio: It reads a huge NASA CSV file, converts it to a dataframe, converts each element to string, and adds them to a vector. RStudio took 4 min and 15 seconds. So I decided to implement the same code in Julia. I ran the following in VS Code: The result was good. The Julia

Reading files faster in python

I’m writting a script to read a TXT file where each line is a Log entry and I need to separate this log in different files (for all Hor, Sia, Lmu). I’m reading each line and dividing in new files with no problem when using my test file (80kb), but when I try to apply to the actual file (177MB

FAST: 1D overlaps with rows in 2D?

let say i have 2D array, f.e.: I want to calculate overlap with 1D vector, FAST. I can almost do it with (8ms on big array): The problem with it is that it only matches if both Position and Value match. F.e. 5 in 2nd column of 1d vec did not match with 5 in 3rd column on the 2nd

Performance tuning: string wordcount in df

I have a df with column “free text”. I wish to count how many characters and words each cell has. Currently, I do it like this: Problem is, that it is pretty slow. I thought about using np.where but I wasn’t sure how. Would appreciate your help here. Answer IIUC: you can try via str.len() and str.count(): Sample dataframe used:

Advertisement