Skip to main content

Questions tagged [python]

Python is an interpreted, general-purpose high-level programming language whose design philosophy emphasizes code readability. Use the python tag for all Python related questions. If you believe your question may be even more specific, you can include a version specific tag such as python-3.x.

5 votes
0 answers
83 views

Optimizing SymPy Implementation of prime factorization in form of QUBO

I'm trying to reproduce a paper on Prime Factorization. This paper converts the problem into a QUBO form, which then we can map it to an Ising Minimizer. I've basically done everything and I've ...
Amirhossein Rezaei's user avatar
4 votes
3 answers
308 views

Calculation of centrifugal liquid propellant injectors

There is this code in which the calculation of the centrifugal nozzle of a liquid rocket engine is performed. All basic calculations take place in the Injector ...
DYNAMIC AEROSPACE's user avatar
2 votes
1 answer
126 views

Check that a string is a palindrome using Cython

I am trying to check if a string is a palindrome in cython. Here is the code I am using: ...
John's user avatar
  • 309
1 vote
1 answer
68 views

Clear the temp folder with Python script

I am addicted to cleaning the %temp% folder, so I went ahead and tried with pyautogui at first by making it click ...
Giannis Tsakas's user avatar
8 votes
1 answer
501 views

Battleship vs. computer with Python

I am still pretty new to Python. After spending time on Code Wars and copying a handful of projects from Al Sweigart's Big Book of Small Python Projects, I wanted to build something completely from ...
Jessica Monnier's user avatar
8 votes
5 answers
1k views

Python matrix class

To prepare for my studies in linear algebra, I've decided to write a simple matrix class. This is the initial program, with functions to find the determinant and decomposition(s) to follow. I wanted ...
Linny's user avatar
  • 10.3k
0 votes
1 answer
46 views

Optimize for compute/timespace - substring matching STD pk / sk format

BUSINESS CASE For users of my application I need to manage a granular list of grants. I'm using an aws dynamodb backend with lite Single Table Design (STD) strategies. A common syntax for STD keys ...
Jamie Marshall's user avatar
0 votes
2 answers
42 views

Slicing or Extended unpacking [closed]

I have a MQTT topic: topic = "namespace/group_id/message_type/edge_node_id/device_id" I want to get the first node and the rest of the topic in a ...
Dorian Turba's user avatar
5 votes
2 answers
165 views

Python script to change monitor refresh rate

I recently overclocked my monitor and I am trying to create a script to just click and do the work for me so whenever I want to change my refresh rate I dont have to open windows settings. I think ...
Giannis Tsakas's user avatar
2 votes
2 answers
158 views

Find the join of two set partitions

Two partitions of a set have a greatest lower bound (meet) and a least upper bound (join). See here: Meets and joins in the lattice of partitions (Math SE) The meet is easy to calculate. I am trying ...
Watchduck's user avatar
  • 150
3 votes
1 answer
66 views

Number of partitions of (a,b) into k distinct parts which sum up to (a,b)

Problem set This is somewhat a generalization of the famous partition of integer n into k parts. Given two integers ...
linuxbeginner's user avatar
2 votes
1 answer
222 views

Python using generators with Excelwriter - Performance

I'm looking to understand if my code has an obvious blockage or performance pain point that will cause it to operate slower or use more memory than it should. The current Excelfile i am processing ...
sayth's user avatar
  • 131
3 votes
1 answer
268 views

Transferring dataframe columns into dataframe rows

I have the following data: ...
mahmoud988's user avatar
3 votes
1 answer
107 views

Benchmark for loop and deque/map/methodcaller

While discussing with some colleagues, one argued that a for loop over a list of objects to call a method is a bad practice because it has bad performance compared ...
Dorian Turba's user avatar
4 votes
2 answers
286 views

Simple size difference measuring tool

Simple tool I wrote in an hour or two (I'm not very fast, but I eventually get there - also for the "spending 6 hours to save 6 seconds" meme). Would've written this in shellscript given ...
404 Name Not Found's user avatar

15 30 50 per page