Quantcast
Channel: Active questions tagged python - Stack Overflow
Browsing all 23276 articles
Browse latest View live
↧

Why I can't connect google functions to Mysql?

I created a google function to connect to Mysql, I created the database using Cloud SQL. I gave it Cloud permissions.Here's the code inside my 1st gen function (main.py). Please keep in mind ""...

View Article


change pitch of note [.wav] without stretching or lengthening note

There may be an answer to this already, or a similar question, but can't find what I'm looking for; what I'm looking for is conceptually simple;I have a wav file for a guitar note (E2, or open E...

View Article


LangChaing Text Splitter & Docs Saving Issue

I'm trying to use the langchain text splitters library fun to "chunk" or divide A massive str file that has Sci-Fi Books I want to split it into n_chunks with a n_lenght of overlapingThis is my...

View Article

how to properly loop and print json record in a single line

The code below loops through the records and displays the result vertical one after another.Here is what i wantI need to print this text in a single line Eg. Stackoverflow.com is a Programmers Question...

View Article

Django views file says

So i have the folloing error: didn't return an HttpResponse object. It returned None instead.And from what I read it was due to to not having a render in the return line, however after checking...

View Article


Aspect Ratio Error When Plotting Points on Map and Setting CRS

I am getting a "ValueError: aspect must be finite and positive" error when I try to plot football stadium locations on a map.The weird thing is that I get the error when I attempt to plot Ukraine,...

View Article

Pytest dependency doesn't work when BOTH across files AND parametrized

I'm running into a problem wherein pytest_dependency works as expected whenEITHERDoing parametrization, and dependent tests are in the same fileORNot doing parametrization, and dependent tests are in a...

View Article

Python tkinter cloase first window while opening second window

I'm trying to close the first window as the second window opens. The first window fails to close, and there is no error message.This question has a similar problem but was solved by addressing the...

View Article


Image may be NSFW.
Clik here to view.

Why is the image result flipped by 90 degrees?

I am trying to turn all of the white pixels in this image red, but when I run the program the shape is fine but the red pixels are rotated 90 degrees:This is the current code that I am using to do...

View Article


How to create a shortcut to print a variable (vscode)

How can I create a custom shortcut for generating code that will print a selected variable in vscode? [1] arr = [1,2,3,4] # I press double left mouse button on 'arr'[2] print(arr) # Then I press...

View Article

Why is my list index out of range in this for loop? [closed]

I've been tasked to write a program that receives user input and then outputs the input but without any vowels.I have this code:text = str(input("Input: ")).strip()# find positions of vowelsvow_pos =...

View Article

Why do my "playersum" and "dealersum" variables end up as 20? [closed]

I'm making Blackjack but my "playersum" and "dealersum" variables, which add up the players card values to get a total, always ends up as 20, no matter what the value or sum of the cards are when they...

View Article

Pandas resample bi-monthly on even months

I've got the following daily data:1983-03-30 0.0012241983-03-31 -0.0037411983-04-04 0.0051211983-04-05 0.0091711983-04-06 0.0063951983-04-07 0.0090301983-04-08 0.0069611983-04-11 -0.0039501983-04-12...

View Article


Image may be NSFW.
Clik here to view.

How to stretch an image along an arbitrary line or around an arbitrary point...

I have a 128x128 image stored as a 2D numpy.ndarray (it's effectively a heatmap, so each entry is just a scalar value). I have identified:one point on my image, P = (x0, y0)a direction v = [v0, v1]a...

View Article

Pandas pd.read_csv(float_precision='round_trip') - still getting rounding

I have a .txt file. I have opened it in Notepad++ and verified one of the columns has float numbers i.e. 1519.75, 1519.25.What do I need to do in order to avoid rounding? I have other files which work...

View Article


Converting PDF to Markdown in Python with structure preservation

I need to convert a PDF text document to Markdown and maintaining its structure (ie. indexed numbered headers and subheaders should have their correspective number of hashtags # in markdown to keep the...

View Article

Image may be NSFW.
Clik here to view.

How can I apply a stamped metal effect into an image?

I am trying to make stamped metal effect into an image, so I go with applying bevel effect like in photoshop and I came across this question. This image for reference about what am I trying to...

View Article


Does a for loop check if you are at the end of the iterable each iteration?

I am new to coding so for practice I was making a function that removes all of a certain character from any string passed into the function. I found that my for loop was not working as expected. It was...

View Article

How to validate XML using SCH (schematron) and XSD in Python?

I'm generating e-invoicing XML files (CII D16B) using Python. These files comply with the EN16931 standard (https://github.com/ConnectingEurope/eInvoicing-EN16931).I need to validate the generated XML...

View Article

Extracting images from PDF using pypdfium2 (Python)

I am trying to extract images from a PDF document using this specific library: pypdfium2 (https://pypi.org/project/pypdfium2/).I would love to use PyMuPDF instead (given it's excellent speed and...

View Article
Browsing all 23276 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>