All Questions
51 questions
6
votes
1
answer
417
views
Implementing a joint differential equation and eigenvalue solver
I've written a Python script to solve a system of coupled differential equations and then use the results to solve an eigenvalue problem. The full problem is:
\$\frac{d^2}{dr^2} K(r) = \frac{K(r)}{r^2}...
1
vote
1
answer
51
views
Plotting determinant probabilities
This is a fun exercise that tries to answer the following question: if the elements from a square matrix are randomly chosen from 0 to 9, is it more like that the determinant would be even or odd?
I'm ...
1
vote
0
answers
319
views
A collection of Python functions that fill a given region with rectangles
These are what I was working on in the last few days, I wrote a bunch of functions that fill a given region with rectangles of different colors.
The functions can:
Randomly split a region into sub ...
6
votes
1
answer
404
views
Calculating quantiles of timeseries data and then create a "fanplot"
My code is working properly, but I am looking for better approach in the calculation of quantiles and the finding of the data in the dataframe.
...
3
votes
1
answer
242
views
Collatz conjecture with plots
I have an assignment where I write a Collatz Conjecture program for a series of starting values from 1 to N and make two plots: number of iterations vs starting value and computed numbers vs starting ...
4
votes
1
answer
425
views
Path of a particle in a non-uniform B field
I have completed my project which simulates the path of a particle trapped in a device known as a magnetic mirror. I would like your thoughts and improvements on my implementation.
Here is the code:
<...
3
votes
1
answer
755
views
Implementing histogram in python
I was trying to implement my own version of matplotlib's hist function and I came up with this:
...
2
votes
1
answer
55
views
Removing Loop from Numpy XOR
I have been playing around with numpy and matplotlib.
My little project was to create a scatter plot ranging from -1 to 1 on both X and Y, but where the shading is done with the XOR scheme.
The ...
2
votes
2
answers
115
views
Downloading COVID data and uploading graphs
So this is a project I have been working on for the last few weeks. Just started learning Python. Started out with bash scripting and got the itch to learn more. Anyway code fetches covid-19 data from ...
1
vote
0
answers
37
views
Spectrograph using array-of-slice-references
I've written a working and complete proof of concept that shows a spectrograph in Matplotlib. I want to nail down this proof of concept before I continue with development, and I'm not thrilled with ...
1
vote
1
answer
122
views
TicTacToe: If an error messages do not appear straight away
I am fairly new to Python and have tried to create a tic tac toe game that is completely automatic, where you can see if a player1 has an advantage if you let it ...
3
votes
1
answer
44
views
Getting Graph and Block Animation to Run Smoothly Together
I have been working on some code that produces a live graphic of a graph and blocks moving. It works in theory but does not look like how I want. The animation runs very slow when showing both the ...
5
votes
1
answer
302
views
Jupyter notebook style help + code suggestions for pandas
I wanted to open source some code to scrape and analyze publicly-filed stock buys and sells from U.S. senators. I'm not familiar with code style for Jupyter notebooks or pandas in general. Would it be ...
2
votes
0
answers
103
views
Profiling for Bézier curve calculations
Recently I posted an answer on a question about Bézier curve calculations. As a micro-synopsis: there are three implementations of De Casteljau's algorithm here, including the original poster's, AJ ...
8
votes
3
answers
825
views
Modifying Titration Data analysis results
This is my first script that I've written. As a result, I'm sure there are extra lines that are unneeded, or maybe better more concise ways of doing things than I have done here. I have tried to add ...