Category "python"

socket.timeout on telegram bot.polling()

When I leave my program running for a few hours and then send a message to the bot it doesn't reply and after a while it generates the following error. Tracebac

How to restart binance threaded websocket after losing internet connection

Is there a way to automatically restart binance ThreadedWebsocketManager when the internet connection was lost?

Solving optimal control problem with constraint x(0) + x(2) =0 with GEKKO

I am starting to learn Gekko and I am testing optimal control problems. I am trying to solve the following optimal control problem with Gekko The solution of t

torchaudio.sox_effects.sox_effects.apply_effects_file requires sox

I have installed sox using pip command, but it says that "torchaudio.sox_effects.sox_effects.apply_effects_file requires sox". Maybe I should install other addi

Python: How to construct a joyplot with values taken from a column in pandas dataframe as y axis

I have a dataframe df in which the column extracted_day consists of dates ranging between 2022-05-08 to 2022-05-12. I have another column named gas_price, which

Getting a Runtime Error in Executable made with pyinstaller

So I have made a game using Pygame, and now I want to make a executable out of it(standalone executable is preferred). So I used this to make the executable: py

Keras ValueError: Dimensions must be equal - How to pass label-dependent values to custom loss function

I have a keras model with 5 outputs. My labels include 5 values to compare these to, but also 25 additional values representing a correlation matrix for the 5 v

when i use docker-compose to install a fastapi project, i got AssertionError:

when I use docker-compose to install a fastapi project, I got AssertionError: jinja2 must be installed to use Jinja2Templates but when I use env to install it,

Airflow without sudo access?

in my virtual env on azure VM, i ran pip3 install apache-airflow when i started airflow db init i received File "/home/shivamanand/myenv/lib/python3.7/site-pack

I want to assign value of logged in user's user_company to the user_company field of the newly created user

When a user creates a user record for a client, the new client should should have the current logged in user's User.user_company value. In the problem here, I w

Convert a Pandas DataFrame into a single row DataFrame

I've seen similar questions but mine is more direct and abstract. I have a dataframe with "n" rows, being "n" a small number.We can assume the index is just th

identity test game of life

I'm writing the conway's game code in python. My code is like this: def update_board(board: list[list[int]]) -> list[list[int]]: rows = len(board) co

Evaluate model result for multitask learning with keras

I designed a CNN for a multitask classification in keras, where I have one input and two different class of classes in output. I compiled the model in this way

Get Futures Asset Balance Binance

I tried searching for answers, but to no avail. How do I get the balance of specific asset for a Futures Asset, for example, USDT? [{'accountAlias': 'xx', 'asse

how insert loading animation during a function in python kivy?

I'm a beginner and would like to insert an MDSpinner while executing a loop, or a mysql query, or some process that takes time. I made this example below to ill

Having trouble switching python versions using pyenv global command

I have installed pyenv on Mac using homebrew and downloaded the version of Python 3.7.9. Everything works except when I use pyenv global 3.7.9, python3 -V still

Having trouble switching python versions using pyenv global command

I have installed pyenv on Mac using homebrew and downloaded the version of Python 3.7.9. Everything works except when I use pyenv global 3.7.9, python3 -V still

ERROR : could not find a version that satisfies the requirement tensorflow

I'm using raspberry model 3B+ , I made a venv and then tried to install tensorflow but I get these 2 errors ERROR: Could not find a version that satisfies the r

SQLAlchemy: JOIN between different databases AND using different files in a module

Stack I am using: Python 3.10.x FastAPI 0.75.x SQLAlchemy 1.4.3x Summary I am building a unifying FastAPI project for several legacy databases (stored back-end

Evaluate model result for multitask learning with keras

I designed a CNN for a multitask classification in keras, where I have one input and two different class of classes in output. I compiled the model in this way