Skip to main content
The 2025 Developer Survey results are in. Explore insights into technology and tools, careers, community and more. View results.

All Questions

Tagged with
Filter by
Sorted by
Tagged with
5 votes
2 answers
329 views

Porting PHP's array_push to Python

I am new to Python but not new to PHP. I've started porting PHP APIs to Python hoping to learn the Python language along the way, currently trying to grasp List, Dict, Set, Tuple. I tried writing PHP'...
hanshenrik's user avatar
7 votes
2 answers
827 views

Number of occurrences of strings in array

This is a Hackerrank problem (https://www.hackerrank.com/challenges/sparse-arrays/problem). We're given an array of strings and an array of queries, and have to return an array of the number of ...
jeremy radcliff's user avatar
9 votes
3 answers
1k views

Creating an affinity-matrix between protein and RNA sequences

I wrote an algorithm that analyzes protein-RNA interactions and I found that the following function is the bottleneck that causes performance issues: ...
KaPy3141's user avatar
  • 263
5 votes
3 answers
2k views

Associating a name with each bit in a bitmask

I have the following code: ...
Francky_V's user avatar
  • 178
3 votes
3 answers
9k views

Intersection of subset between two lists of dicts

I want to find the intersection of two lists of dicts. Note that equality—i.e.: what is to appear in the intersection—is given by which keys they must have equal. See the ...
A T's user avatar
  • 535
10 votes
3 answers
86k views

Convert dict entries to sets and lists

Can you please tell me if there is a better way to do this? ...
Mark's user avatar
  • 443
6 votes
3 answers
949 views

Parsing a complicated CSV generated on election nights

I have a Python script which parses a complicated CSV generated on election nights. Each row of the CSV represents a race. As I loop through the races, I store the candidates for each race into a list ...
Kirkman14's user avatar
  • 205