Questions tagged [python]
Python is a dynamically typed, multi-purpose programming language. It is designed to be quick to learn, understand, and use, and enforces a clean and uniform syntax. Note that Python 2 reached end-of-life on January 1st, 2020. For version-specific Python questions, add the version tag (e.g. [python-3.x] or [python-3.9]). When using a Python variant (e.g. Jython, PyPy) or library (e.g. Pandas, NumPy), please include it in the tags.
python
2,204,168
questions
0
votes
0
answers
2
views
from redis.commands.search.field import TagField, TextField, VectorField ModuleNotFoundError: No module named 'redis.commands' ERROR
from redis.commands.search.field import TagField, TextField, VectorField
ModuleNotFoundError: No module named 'redis.commands'
i have the above - and am using redis 3.5.3
how can i ...
0
votes
0
answers
5
views
pycharm Unresolved attribute reference 'astype' for class 'ndarray'
Q: How can I fix the bug where Pychram warns about numpy.ndarray attributes?
The code runs with no problem, however pycharm keeps giving this warning
Unresolved attribute reference 'astype' for class '...
-1
votes
0
answers
8
views
I am getting this error, it is asking to input the parameter , but the way I defined next_question() method it shouldnt ask for any parameter
[](https://i.sstatic.net/YjBitazx.png)
I was trying to run this program but i got an error, pointing out that next_question() method requires one positional argument called self , I am new to ...
0
votes
1
answer
14
views
How do i shift the axis of a chart in plotly
I'm trying to make this ridgeplot chart in plotly and its mostly working ok, but for some reason the top trace is getting cut off and i can't figure out how to move the trace down a bit. I can do it ...
0
votes
1
answer
8
views
How do I add 'week of year' and 'day of year' columns to a python datatable?
There is currently (version 1.1.0) no python datatable.time.week() or datatable.time.day_of_year() functions.
Here is some example data:
from datetime import date
import datatable as dt
DT = dt.Frame(...
0
votes
0
answers
4
views
cognito with lambda verify_auth_challenge returning incorrect username or password when responding to custom challenge
I am trying to implement email based MFA using AWS congito and Lambda triggers and using lambda functions trigger and verify mfa_code. I am able to pass PASSWORD_VERIFIER challenge and also able to ...
0
votes
1
answer
16
views
Uninstall package with non-python files that weren't in distribution
I have a python app that has been deposited on pypi as described here. The app runs an external software (blast+) and generates non-python files (various database and txt files, and an xml file that ...
-3
votes
0
answers
17
views
How to open a browser with Python and give him SSL Certificate?
I need to host a local host server and then open a web browser that uses that server. However, the server needs to be https for further functions. So I start the server with self signed-certificates, ...
1
vote
2
answers
23
views
How to put two images, left and right aligned in header in a word file (.docx) Python
I want to put two logo images in the header of the document. One logo should stay at the very left and the other at the very right of the word file. Below is my code, but this sets both logos on the ...
-1
votes
0
answers
14
views
Are staticmethods and classmethods bad practice? [closed]
In python, during a recent code review, it was pointed out that using classmethods and staticmethods is considered a bad practice because it enlarges the scope of the given class.
In the specific case,...
0
votes
0
answers
7
views
Unable to fetch basechain transcation
I created a wallet using this code :
from eth_account import Account
# Create a new Ethereum wallet
account = Account.create()
private_key = account.key.hex()
address = account.address
print("...
-1
votes
0
answers
9
views
Unexpected Index Behavior in Python [closed]
In file handling, when I use the seek operation with the newline character and input the string “Hello User,\nI am the main file” into the file, I encounter an issue. When I read using the seek ...
0
votes
0
answers
7
views
Unpickling Error: magic_number = pickle_module.load(f, **pickle_load_args) _pickle.UnpicklingError: invalid load key, 'v'
When I am trying to load a .pt file i am seeing the following error,
str1='Dataset/ALL_feats_cgqa.pt'
m = torch.load(str1)
the error is as follows,
File "/home/Storage1/pythonCodeArea/train.py&...
-1
votes
1
answer
17
views
How to change the Directory in Python in below format? [closed]
A part of code
area_file = open('/home/gkrish19/SIAM_Integration/Final_Results/area_chiplet.csv', 'a')
area_file.write('Total NoP Driver area is' + '\t' + str(Nop_area) + '\t' + 'um^2')
area_file....
0
votes
0
answers
5
views
How to separate dynaconf settings for each environment in it's own file?
Im using dynaconf 3.2.4 to load my config files. I want have seperate files for each environment: config.dev.yaml, config.test.yaml, config.prod.yaml, etc.
I want to keep my files simple and do ...