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.
                15,576 questions
            
            
            
                2
            
            votes
        
        
            
                3
            
            answers
        
        
            
                1k
            
            views
        
        
            
            
            
        Build datasets larger than GPT-1 & GPT-2 with ~200 lines of Python with textnano
                    Lightweight text dataset builder for ML with zero dependencies
Context
I'm returning to Python development after a break and actively learning AI/ML. As part of my learning journey, I'm building a ...
                
            
       
        
            
                5
            
            votes
        
        
            
                3
            
            answers
        
        
            
                887
            
            views
        
        
            
            
            
        Moving ball simulation within a donut
                    How do I optimise my code more?
The goal is to have my code work with more than 200 moving balls, but that takes forever right now and doesn't look smooth at all. Furthermore, I can't get the sizing ...
                
            
       
        
            
                2
            
            votes
        
        
            
                1
            
            answer
        
        
            
                62
            
            views
        
        
            
            
        Managing a global backend/device state when making a deep learning framework
                    I have been making a deep learning framework modelled after Pytorch in pure Python. I have made good progress but my framework is currently not seamless to use because the end user of the framework ...
                
            
       
        
            
                11
            
            votes
        
        
            
                5
            
            answers
        
        
            
                852
            
            views
        
        
            
            
            
        Python program that iterates over audio files with a progress bar interface
                    I have a utility that updates, transcodes and renames audio files.   Previously I used a function that simply yielded every file that was a good match (based on file extension).
As some tasks can take ...
                
            
       
        
            
                10
            
            votes
        
        
            
                4
            
            answers
        
        
            
                648
            
            views
        
        
            
            
        Split flap clock stepper code
                    I've built a Split Flap Clock, and the code has grown quite a lot, and although it does work in its current state, I am wondering if it could be cleaned up.
The whole thing runs on an ESP32 and is ...
                
            
       
        
            
                2
            
            votes
        
        
            
                2
            
            answers
        
        
            
                91
            
            views
        
        
            
            
            
        Heat Diffusion Equation Solver
                    I'm implementing a numerical solver for the 1D diffusion (heat) equation using an iterative method. The initial temperature distribution is a Gaussian profile, which should theoretically smooth out ...
                
            
       
        
            
                4
            
            votes
        
        
            
                2
            
            answers
        
        
            
                488
            
            views
        
        
            
            
            
        Finding a sequence of xors to change a to b
                    I'm resolving a problem from CodeForces: C. Beautiful XOR. This is what the code is supposed to do:
You have two numbers a and b.
You must transform a into b using XOR operations (...
                
            
       
        
            
                2
            
            votes
        
        
            
                2
            
            answers
        
        
            
                106
            
            views
        
        
            
            
            
        Calculation of liquid propellant nozzles
                    I'm calculating the injectors, and I've added the complete calculation code and tested it using pytest. Can you suggest a better way to structure the code so that I ...
                
            
       
        
            
                6
            
            votes
        
        
            
                2
            
            answers
        
        
            
                627
            
            views
        
        
            
            
            
        Python calculator application
                    What do you think about my calculator application in Python? Are there any hidden bugs that I haven't noticed yet? Let me know about them.
Note: to be able to run this program you need first to ...
                
            
       
        
            
                9
            
            votes
        
        
            
                4
            
            answers
        
        
            
                799
            
            views
        
        
            
            
            
        Find the smallest semiprime satisfying a bunch of conditions
                    The purpose of this code is to find the smallest semiprime \$s = a b\$ satisfying a bunch of conditions stated in the Math.SE question What is the smallest "prime" semiprime?. The conditions ...
                
            
       
        
            
                6
            
            votes
        
        
            
                2
            
            answers
        
        
            
                447
            
            views
        
        
            
            
        Number-guessing game on command line
                    I am just starting coding, and this is my attempt at the famous number-guessing game.  Any and all feedback and criticism is greatly appreciated.
...
                
            
       
        
            
                4
            
            votes
        
        
            
                4
            
            answers
        
        
            
                1k
            
            views
        
        
            
            
        
            
                10
            
            votes
        
        
            
                4
            
            answers
        
        
            
                1k
            
            views
        
        
            
            
        Yet Another Python Weather Visualizer using Open-Meteo
                    As a personal project to build my portfolio, I've created a simple weather app that displays temperature, precipitation, and wind for any given city. This is my first time building a GUI using ...
                
            
       
        
            
                7
            
            votes
        
        
            
                3
            
            answers
        
        
            
                443
            
            views
        
        
            
            
            
        Polars crosstable between two variables in a dataframe
                    I wrote a function that computes the cross tabulation between two variables in a polars dataframe.
It supports absolute values, row percentages, column percentages ...
                
            
       
        
            
                5
            
            votes
        
        
            
                5
            
            answers
        
        
            
                1k
            
            views
        
        
            
            
            
        Check whether a binary tree is symmetric
                    I implemented a recursive solution that compares the left and right subtree in mirrored fashion.  It works for my test cases, but I would like to know if there are any best practices that would make ...
                
            
       
         
         
        