82 questions from the last 7 days
Advice
0
votes
23
replies
521
views
Is this possible? A new AI-age language, as easy as Python, as fast as C++, more secure than Rust
With the AI being so powerful, we should have a better programming language. This language is named cpluz/cz, signifying that it is generally between C and C++, but with some differences. Because its ...
2
votes
2
answers
242
views
Python RE didn't find the last empty string in back reference pattern
The following code contains two patterns, the first pattern is (1)?, and the second pattern is (1)?\1.
The output of findall_no_reference is correct because it contains the last empty string, but the ...
3
votes
2
answers
91
views
Fusing row with previous row(s) depending on criteria
I'm trying to fix a CSV file I received in which actual new lines were inserted throughout the data, effectively splitting one row of data into multiple ones with incomplete columns. The line breaks ...
Advice
0
votes
6
replies
102
views
Is yml easier then python?
I know it seems like a very stupid question, but my brother said it was easy, so I wonder now if yml is easier than python. He says it's just remembering names and values which does make it seem ...
1
vote
2
answers
125
views
How can I set a placeholder (sentinel) without using None?
I have a value that always needs to be defined but may not always be meaningful, and I need a placeholder for when it doesn't yet have a meaningful value. Usually, I would use None as that placeholder ...
Advice
2
votes
2
replies
190
views
What does the future holds for programmers
Good day everyone,
I'm honestly feeling a bit lost right now and could really use some advice about my career, my growth, and my place in programming.
This is my background: I work with an ...
1
vote
3
answers
115
views
Why does Python not call the function descriptor inside this other descriptor?
I have the following code:
class Identity:
def __init__(self, value):
self.value = value
def __get__(self, obj, objtype=None):
return self.value
def __set__(self, obj, ...
3
votes
1
answer
123
views
How to find the API endpoint behind Paribu Fear & Greed Index chart?
I'm working on a personal project that needs the exact Fear & Greed Index values
displayed on Paribu's trend page:
https://www.paribu.com/kripto-trend-analizi
The page shows a chart with 1H/4H/1D/...
Best practices
1
vote
13
replies
137
views
Series cancelations accumulate errors, how to avoid?
import math
import matplotlib.pyplot as plt
import numpy as np
m=50
def taylor_cos(x,n):
sum=0
for i in range(0, n):
sum=sum+ (((-1)**i) * (x**(2*i)) / math.factorial(2*i))
...
Advice
0
votes
4
replies
103
views
Split integer into chunks to monitor workflow
I am using python and gspread to manipulate a google sheet and want to be able to track how many rows have been processed. I can pull then number of rows in the sheet by doing num_rows = len(sheet....
2
votes
2
answers
102
views
How to maintain scale when rotating?
I've been messing around with OpenGL/ModernGL in Python/Pygame, and after getting my images rendered to the screen, I have been having issues rotating them.
I'm aware of the order that I need to ...
Best practices
0
votes
11
replies
93
views
What to use when moving from static json files ( Javascript ) to database in FrontEnd
I was hoping to get some help with my little project where I noticed that I would need to be using Database instead of local Json files to deal with frontend dynamic content.
So I have a dropdown ...
3
votes
1
answer
135
views
Python crashes when reading some keys with os.read
The interpreter crashes when reading ^4. I know ^\ is SIGQUIT. I tested other sequences, and I didn't find anything else that crashes the interpreter. I also ran stty -a, which yielded this:
speed ...
Advice
1
vote
4
replies
116
views
Designing rewrite rules for logical expressions in Python
Title: Designing rewrite rules for logical expressions in Python
I'm building a small symbolic logic system in Python, and I'm trying to figure out how to implement rewrite rules for logical ...
2
votes
1
answer
99
views
How to calculate the mean value of a variable on a specific day of the year over several years
I have an xarray DataArray that contains daily data for every day from 1970 to 2023 for the months October through March, and I want to calculate the average value of the variable for each day (e.g. ...