Category "python-3.x"

How do I update value in a nested dictionary given a path

I have a nested dictionary nested_dictionary = { "a": { "1": 1, "2": 2, "3": 3 }, "b": { "4": 4, "5": 5, "6": {"x": 10, "xi": 11, "xii": 13}} } I a

Chrome Devtools Network Selenium python

I am making a code with Selenium in Python and collecting data on a website, and I have noticed that in Chrome's Devtools specifically in the "Network" section

Azure pipeline can't find the user created python module

I am attempting to run tests from a python module using Azure DevOps. I've got a pipeline build set up to build of a yml file and also using classic editor. I'm

How to convert symmetric matrix to adjacency table

How could I convert symmetric matrix: A B C D A 1 2 3 4 B 2 1 2 3 C 3 2 1 2 D 4 3 2 1 into adjacency matrix?: A A 1 A B 2 A C 3 A D 4 B A 3 B B 1 B C 2 B D

Write data in unknown encoding

Is it possible write data to a file in an unknown encoding? I cannot decode email headers, for example message-id, because if I use handler ignore or a replace

Why Python String auto convert into Date in microsoft excel

I am writing data into a CSV file. file contains data related to student marks like 6/10, which means 6 out of 10. here the issue is when I open this file with

Type object 'By' has no attribute 'Link_text'

Get tired to guess proper syntax. Please, help me out with my problem! Writing code in Python3. My code: from selenium import webdriver from selenium.webdriver.

Pagination not working in Python Session.put()

I am trying to upload a file to a website (that has an inbuilt API) using the following code. The code reads a list of medical codes/diagnoses codes etc. (1 col

starting celery worker from python script results in error - "click.exceptions.UsageError: No such command" using celery==5.1.2

Directory structure: Here is my cw_manage_integration/psa_integration/api_service/sync_config/init.py: from celery import Celery from kombu import Queue from

Keep state in decorator

I am trying to write a @assert_logged_in decorator. On paper, it's easy: def assert_logged_in(meth: Callable): logged_in = False def wrapper(self, *args

Programmatically establish boto3 sessions with AWS SSO

I'm trying to establish a boto3 session with boto3.session.Session(profile_name='foo') but getting an UnauthorizedSSOTokenError error: botocore.exceptions.Unau

Keras Model doesn't seem to be loading weights?

I can get the model to train effectively. However, I am now having a problem with it comes to loading the model and testing it on new data again. I was able t

note: This error originates from a subprocess, and is likely not a problem with pip

while downloading pip install allennlp==1.0.0 allennlp-models==1.0.0 I faced this problem : [6 lines of output] running bdist_wheel run

Calculate The Discount of a Product using a Python Code

I am currently trying to create a code that will calculate the discount (in percentage) of a product. The code is supposed to ask the user of the code for the

Move Linear Actuators using softPWM wiringpi

I am using softPWM from wiringpi library to control linear actuator speed and direction. I have raspberrypi 4b connected to BTN8982TA motor driver which is in-t

Server response problem with character encoding format in Spanish

I'm tryng to retrieve information from the following url: https://fenixservices.fao.org/faostat/api/v1/es/data/PP?area=2%2C3%2C79%2C7%2C8%2C151%2C194%2C4%2C9%2C

How to get the relation between categorical and numerical variables of a dataframe?

I have a dataframe with 49 columns. Most of them are categorical (dtype object), some are numerical. As I'm a newbie in data science I tried to plot the Pearson

Script to read file and print first two and last two lines of it

I'm writing a program where the user inputs a file name and then the file and prints only the first 2 and the last 2 lines of the file. I have worked out how to

How to resolve this error while installing pyrebase?

ERROR: Command errored out with exit status 1: command: 'c:\python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\rkapr\\A

TypeError: 'ZipFile' object is not callable

I am trying to save the new cropped brain tumor images into the subfolders of TRAIN_CROP, TEST_CROP, and VAL_CROP in the main folder of TRAIN, TEST, and VAL. x