1,111 questions
1
vote
1
answer
65
views
Matplotlib requires dateutil
I installed matplotlib, tried to run the program, and get an error:
Traceback (most recent call last):
File "C:\Users\kystepa2\Desktop\NEXTSY_PROJECT\TEST\mtsa\plot_metrics_mtsa.py", line ...
0
votes
0
answers
56
views
GSTR1 Excel Template Processing - Warning Dialog Issue
We process government tax report templates using Python + openpyxl. Recently, the template provider released v2.1 with new sheets. Our code works fine, but generated files now show Excel's recovery ...
1
vote
2
answers
636
views
Im using polars library, but I'm getting 'NameError: name 'PyLazyFrame' is not defined using polars'. Im' using python 3.9 and polars 1.21.0
Im trying to get data from a parquet file using SQL syntax.
The code:
import polars as pl
# Ensure the variables are defined
parquet_file = r'C:\Users\Kperez\Documents\md_curated_20250115.parquet'
...
2
votes
2
answers
99
views
Is there a more elegant rewrite for this Python Enum value_of implementation?
I would like to get a value_of implementation for the StrEnum (Python 3.9.x). For example:
from enum import Enum
class StrEnum(str, Enum):
"""Enum with str values"""
...
0
votes
0
answers
117
views
AttributeError: 'numpy.ndarray' object has no attribute 'categories'
Modin DataFrame Merge Issue After dropna on Categorical Column:
I'm encountering an issue when using Modin to merge DataFrames that contain categorical columns. The issue arose after I performed a ...
0
votes
1
answer
82
views
Python scorecardpy: UnboundLocalError: local variable 'card_df' referenced before assignment
I used scorecardpy function to get a model:
import scorecardpy as ac
card=sc.scorecard(bins_adj, lr, X_train.columns)
Then I tried to save this model using following code:
import numpy as np
np.save('...
0
votes
1
answer
30
views
My if statement isn't getting ignored after the == isn't the input it is required
after I run the code it still will be 15 even if the input isn't yes or Yes. I'm new to Python - can anyone please help me?
The statement:
if stuffed == "yes' or "Yes" :
price = 15
...
0
votes
1
answer
45
views
Set scrollbar to the LEFT with grid layout manager
I get read, that you can place the scollbar to the LEFT in .pack() layout manager, but I can't find a working solution for .grid() layout manager. The description in my book say I should use sticky = '...
0
votes
1
answer
128
views
Automatic resize Treeview (column width & row height) size inside ttk.Notebook
I create a treeview inside a tab from ttk.notebook widget.
I followed this description for addapt the size of the treeview table. I saw also the .pack solution, but I will not mix .grid and .pack(). I ...
1
vote
2
answers
667
views
No module named 'distutils.cmd' with Python3.9 in Ubuntu 22.04
I've created a virtual environment of Python3.9 with Pycharm but when I try to install the packages in requirements, I get this error:
Error: Traceback (most recent call last):
File "/snap/...
-4
votes
1
answer
51
views
Why does this global not stay updated when we return back to main, unless I add a new entrypoint to my program? [closed]
m1 is a global variable in collect_finetuning.py:
m1: list = []
When I run collect_finetuning.py via:
if __name__ == "__main__":
main()
We see this behavior, where a function in ...
2
votes
1
answer
2k
views
Docker script installing python 3.9 started failing recently
We have a solution deployed on AWS where an EC2 instance uses docker files to build images for different components. One of those components has a docker script we haven't changed in over a year that, ...
1
vote
1
answer
29
views
models.ManyToManyField Necessity
I can't understand, what benefits we get when adding models.ManyToManyField if using intermediary model? Is it necessary?
I want to use base (not custom) user model in my project. Should I redefine ...
0
votes
1
answer
221
views
pip install pytrec_eval fails with ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED]
I am trying to install pytrec_eval package using this command python -m pip install pytrec_eval but it fails with the following error: ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] ...
0
votes
1
answer
111
views
How do I create a custom button class in tkinter?
I want to create a custom class for the tkinter button class. However when I run my code the button doesn't appear on my window. The programme doesn't throw any errors either. Running on Mac on python ...
0
votes
0
answers
244
views
Error when installing tensorflow_federated package in VS code in Windows 10
I want to install tensorflow_federated package in VS Code in Windows 10 by using 'pip install tensorflow_federated' command. My python version is 3.9.0. But I get this error:
WARNING: Ignoring invalid ...
2
votes
0
answers
441
views
ssl verification throws error with python 3.12 whereas in python 3.9 it succeeded
With python 3.12 I got the error:
SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1000)')
But with python 3.9 its working ...
2
votes
0
answers
211
views
PySpark socket timeout error when using .collect() or .count()
I have been working with PySpark and distributed computing to do work with dataframes that involve querying PI I have been working with the User Defined functions and have managed to get a semi ...
1
vote
2
answers
52
views
Why is my Python code executing the lines after the if-else statement before the lines within the if-else statement?
I am a beginner at programming on Python.
I made a program with Chatgpt that I don't fully understand, but I know that I want to make many more if-else statements without making it complicated with ...
0
votes
0
answers
160
views
ImportError: tools/python/lib/python3.9/lib-dynload/math.so: undefined symbol: PyFloat_Type
I am using Python 3.9 on Linux. The python installation structure looks like:
/tools/python/bin - containing python executable
/tools/python/lib/libpython3.9.so
/tools/python/lib/python3.9/lib-...
0
votes
0
answers
45
views
Tkinter bind double click not working as expected with multiple instances of the same object
I'm trying to write a utility that will allow me to query a database, display the returned data and then allow the user to double click on one item to load/expand it. I've come up with the class below;...
0
votes
0
answers
71
views
Error in reading .gz file in python using gzip
I am using code to read file from AWS s3 bucket using boto3, throwing error "Not a gzipped file (b'\xef\xbb')"
even if filename is ends with .gz and the content type is also application/x-...
0
votes
2
answers
606
views
How do I reload a python module?
This has been asked 1000 times before, but nothing seems to work for me.
Using Python3.9 and VScode, though I have tested it making edits with just the plain TextEdit app on mac as well.
I cloned this ...
-1
votes
1
answer
1k
views
trying to use this python code i found online to translate images with Google Translate in bulk but keep getting the "No module named 'google' error"
i'm trying to use this code i found online to translate images with Google Translate in bulk
# Args:
# input_dir: The directory containing the images to be translated.
# output_dir: The ...
1
vote
2
answers
135
views
Get data from multiple tags from XML file
Having an XML like this:
<?xml version="1.0">
<!DOCTYPE us-application SYSTEM "us" []>
<us-application lang="ENG" dtd-version="v4">
<us-...