Category "python"

drf_yasg.generators: path component of api base URL http://localhost:8080/ is ignored; use FORCE_SCRIPT_NAME instead

I am using swagger (drf_yasg.generators) with Django and I get the following error message Error message is drf_yasg.generators: path component of api base UR

How to format a string in Python source code for improved readability [duplicate]

I'm building a rather long file path, like so: file_path = f"{ENV_VAR}/my_dir/{foo['a']}/{foo['b']}/{bar.date()}/{foo['c']}.json" This is a s

How can get the hexagons and circle in this image with opencv?

I can's find the hexagons and circle clearly in this image, in the process of finding, i have used too many normal ways but there was still have no effective

Is there a WebSocket command to execute the code blocks in a SageMaker notebook instance once there is a successful connection?

I have written a Lambda Function to start a SageMaker notebook instance, create a WebSocket connection, then execute the ipynb file inside the notebook instance

Python Plotly Subplots with an x shared axis and multiple y axis

I would like to know if it is possible to create subplots with Plotly with an x shared axis and multiple y axis. This what I want to do: where '##' means the pl

Don't understand how to code the condition [duplicate]

There are no errors in this but I can't understand how to code the condition. If I change the condition to if money != string.digits: and run

Blender 3.0 with Modifiers in Python

The following script from https://b3d.interplanety.org/en/how-to-apply-modifier-on-selected-objects/ doesn't work. I'm using Blender 3.0 with the Python API. I

Memory issues with a list of lists [closed]

I am having some memory issues and I am wondering if there is any way I can free up some memory in the code below. I have tried using a genera

JSONDecodeError: Expecting value: line 1 column 1 (char 0) on Raspberry Pi's Imager (GNU/Linux)

I've made an image recognition neural network in windows. Tested it, and it works (hurray!). It uses tensorflow. Now I wanted to transfer it on Raspberry Pi's I

Regex to match multiple numbers within string

I have a regex that looks like this to extract order numbers from columns: df["Orders"].str.extract('([0-9]{9,10}[/+ #_;.-]?)') The orders column can look like

Django `LookupError: App 'accounts' doesn't have a 'User' model` causes AUTH_USER_MODEL fails with `accounts.User` has not been installed

I am trying to refactor an existing code base by creating new accounts app with new custom User model. When I try to do makemigrations, I get the following erro

HTML not being displayed properly in Flask, Python

I am trying to make a website using Flask. I have designed the HTML using TeleportHQ, a drag and drop HTML designer that gives you the HTML and CSS files. I hav

Kaplan meier calculation with alive, died and censor in python

I have data of years and how many survived, died and censor (withdraw) each year. Sample data is given below. It shows year, status, and total individuals in th

Python Upgrading leads to terminal... not opening

I just upgraded python in ubuntu to python 3.10 to use the match/case statements, but now, my terminal won't open. Anywhere. I tired opening it on Visual Studio

Problems concatenating arrays by session

I apologize in advance for the title, my question is not that easy to explain on it. What I mean by that is the following: Having an array of type, 4x4, it has

pip install requierements.txt in azure app service

I want to launch a web app on Azure app sevice connected to my azure repo, but I have this problem ERROR: Command errored out with exit status 1: /tmp/8da0e5879

Openpyxl - Merge same cells in column

I'm having trouble making a function that looks through a column (or each column) in the dataframe I'm writing and merging consecutive cells ie. Would apprecia

ipynb files opening in JSONformat in VSCODE

I am trying to open ipynb files in VSCODE in Ubuntu. But the files are not opening as notebook editor. Instead it is showing as raw json format. can you please

I am trying to make 2 person game

Hello I am tryna make 2 person guess the number game but I dont know how to show the win message can someone help? guessp1 = int(input(player1 + "'s turn = "))

model.predict_classes is deprecated - What to use instead?

I have been trying to revisit my python code for prediction on neural network and i realized after running the code that model.predict_classes is deprecated sin