Category "python"

Install Django on Gandi instance

I am trying to install an Django app on Gandi. For now, what I have is un file name wsgi.py: import sys import os import os.path sys.path.insert(0, os.path.abs

How to use Gridsearchcv to tune BaseEstimators within AdaBoostClassifier

from sklearn.svm import SVC from sklearn.tree import DecisionTreeClassifier from sklearn.model_selection import GridSearchCV from sklearn.ensemble import AdaBoo

How to make a chatbot for discord using python

I need advise and/or resources to make a chatbot for discord in python, i have some knowledge of python and the discord api but I know nothing about chat bots o

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.