Category "python"

AWS Glue - IllegalArgumentException: Duplicate value for path

I have a messy data source where some field values can come in with two different names but should map to one conformed field name on the output. e.g. data sour

Recursion python - counting vowels in a string

The following code is from geeks for geeks - link When I executed to visualize the code line by line on pythontutor.com, I understand that n is being reduced to

How can I create a launch.json to use pipenv scripts?

I have the following folder structure in a monorepo repository /--.vscode /--Services --/Service1 --/Service2 --/Service3 In each service, I am using pip

Problems with pip und Command line

I am trying to create a Python pip package. This works also well. I can successfully upload and download the package and use it in the Python code. What I can't

How can I create a launch.json to use pipenv scripts?

I have the following folder structure in a monorepo repository /--.vscode /--Services --/Service1 --/Service2 --/Service3 In each service, I am using pip

IndexError: list index out of range with api

all_currencies = currency_api('latest', 'currencies') # {'eur': 'Euro', 'usd': 'United States dollar', ...} all_currencies.pop('brl') qtd_moedas = len(all_curr

IndexError: list index out of range with api

all_currencies = currency_api('latest', 'currencies') # {'eur': 'Euro', 'usd': 'United States dollar', ...} all_currencies.pop('brl') qtd_moedas = len(all_curr

Return does not return information

When wanting to return a value with the return and wanting to use it later in a variable, nothing is returned to me. #Actualizacion de informacion def messageHa

How to create a loop/function to open set of shapefiles?

How can I create a loop or a function to open many shapefiles at the same time where the names of the shapefiles change very little? For example with the data b

Is there a way to make sure formatted string is always in quotations?

I am working on a new tool to help automate some tedious processes. it involves ExchangeOnlineManagement, Python, and Powershell. I have input variables that I

How to use multiple databases in Django with an empty 'default'?

I'm trying to make a multiple database project in Django. But I'm having problems to properly migrate my models to the appropriate database. I'm using the 'Writ

It doesn't pick up the variable correctly in subprocess.call (python)

I am creating a telegram bot to send the information that I request to the app. When I run the code below it works fine except for the last part, when it does t

Error in .exe of python script having Barcode from Reportlab.graphics

I have a python script for generating barcodes (code128) which works fine in IDE. But when converted into exe, it encounters below error: Traceback (most recent

How to get all checked items in SelectMultipleField in WTForms + Flask

I have a SelectMultipleField but when I try to access checked items, thought form.fields.data I only get the first of them. More over, by trying to get answers

Why is are my rows not being written to the CSV file?

With the code below the CSV file aaab.csv is created but nothing is written to it. The print(row) gives me the correct information. What am I doing wrong? I hav

Date and time conversion using Pandas & Python to create Ts

I'm trying to get Ts using my existing data of data and time, which looks like (Pdb) df[0][:7] 0 [Data & Time] 1 Jan 01 08:00:01.193 2 Jan 01 08

cv2 SystemError when using webcam on MacOS

I am trying to run a very simple script using opencv, which should display frames from my webcam (on a 2019 macbook pro running OS Catalina) until interrupted.

Python error - Traceback (most recent call last)

I entered this code. I entered the example alike in the book where I could study Python. from turtle import Screen, Turtle import random screen=Screen() image1

How to create a timed input in python with a correct answer?

How would I create a program which asks the user for an input but if they dont respond with an answer within 5 seconds tells them that the time is up. But if th

What's the best practice for Python multiprocessing to write to a shared dictionary?

I have millions of NumPy arrays that I wish to process, ultimately generating a collective histogram plotting the frequencies of seen integers. I wish to utiliz