Category "python"

Can't migrate after makemigrations on django

everyone. I newbie in this field. So, After I finished makemigrations. then I migrate this error code occurs. I try to solve it but still stuck. please guide, I

Cannot create SQLAlchemy engine, getting error "loaded 'mysqldb' is not async"

I'm trying to replace Databases with SQLAlchemy 1.4 async. When I try to make the engine I get the following error: sqlalchemy.exc.InvalidRequestError: The asyn

Trying to play sound with python opencv with specific pose

hello i'm trying to play some sounds with a specific gesture with my hand but don't know the conditions to play that sound while (for example): my hand is in fe

How to calculate Kinetic energy and potential energy of a Ball?

I want to calculate the Kinetic energy and potential energy of the ball I just Spawned inside a Pymunk space. I wanted to replicate this. Where the values chang

Pandas Dataframe Categorical data transformation

I am having pandas dataframe as follows: import pandas as pd # dictionary with list object in values # Item=[Item1, Item2, Item3] details = { 'Date' : [

Can I use pyglet.gl drawing on pyglet's canvas without pyglet's window?

Is it possible that only using opengl and pyglet's canvas without pyglet's window? I only need to get image array from pyglet.image.get_buffer_manager Left wind

FastAPI server returns "422 unprocessable entity" - value_error.missing

from http.client import responses from random import randrange from tkinter.tix import STATUS from typing import Optional from urllib import response from fasta

Use Index of the Loadings (IL) method to calculate the optimal number of principal components

I want to use Index of the Loadings method to calculate the optimal number of principal components using the index_of_loadings_matrix function. My dataframe was

cannot import name 'BatchNormalization' from 'keras.layers.normalization'

I'm learning ObjectDetection from this website I have installed ImageAI,Tensorflow and Keras. Then when I run this in python from imageai.Detection import O

Package sparse_dot_topn in Pyspark AWS EMR Jupyter install error

Running on AWS and EMR, Jupyter, Pyspark notebook and trying to install a python package "sparse_dot_topn" version 0.2.9 I'm getting an error I don't understand

how to upload audio files to heroku server using python

i have a python program that records sounds,and creates .wav files of these sounds. now i have .wav files on my local machine. for example, recording1.wav. now

How can I send image with text using telegram bot API?

I'm trying to send a message to telegram using Telegram API bot. I want to make a GET request, that will send both text and image to my telegram channel. Now fe

Error while installing pytq5 with pip: Preparing metadata (pyproject.toml) did not run successfully

I try to install pytq5 with pip and get this error $ python3 -m pip install PyQt5 Collecting PyQt5 Using cached PyQt5-5.15.6.tar.gz (3.2 MB) Installing buil

Is there another way of generating tfrecords?

I am trying to run the following command to !py C:/Users/Desktop/dataset/workspace/annotations/Annotations/generate_tfrecord.py -x C:/Users/Desktop/dataset/Work

Error with default value in enum field when define model class

Hello I have the following model: class Status(Enum): scheduled: 'scheduled' recording: 'recording' complete: 'complete' failed: 'failed' @dat

Weird behaviour when finetuning Huggingface Bert model with Tensorflow

I am trying to fine tune a Huggingface Bert model using Tensorflow (on ColabPro GPU enabled) for tweets sentiment analysis. I followed step by step the guide on

Change values of column in df using conditional in two columns

I'm having the following problem: I'm working with a dataset that can be found at https://www.kaggle.com/datasets/ricardomattos05/jogos-do-campeonato-brasileiro

Can I change model admin verbose name based on user group login in django?

I am aware of the Model Meta tag to specify the verbose_name, verbose_name_plural. But require the verbose name in model admin based on user login based on the

List in Python help needed: how to Avoid calling repetitive code

I have a function shown below: def _extract_parent(matched_list, json_data, info_type): return [json_data[match_lst][info_type] for match_lst in matched_lis

How should I preferably "run" Python scripts in RStudio? Through run (using reticulate::repl_python()?) or source?

I just started to use RStudio with Python (up to now everything works) and I wonder if there is a preferred way to run scripts such as my small Test.py containi