Generate geojson polygon of islands coasts using a openstreetmap or other
Is there a way to automatically generate points of coordinates for the contour of islands using existing map ?For instance using directly the points of the map of openstreetmap (or other), let say with...
View ArticleMat1 and mat2 shapes cannot be multiplied (8x10 and 8x8)
[I know this question comes a lot, but I could not find any answer matching my use case]I feed N = 10 inputs made out of 8 floats to a 8 input layerbut I get that errorMat1 and mat2 shapes cannot be...
View ArticleInsert variable values into a string [duplicate]
I want to introduce a variable [i] into a string in Python.For example look at the following script. I just want to be able to give a name to the image, for example geo[0].tif ... to geo[i].tif, or if...
View ArticlePython: How to call the values in a string? [duplicate]
I'm a newbie of Python. In the following code(or see attached), I want to call all the numbers input inside a string in the last step of the program. How should I do that?print "how old are you?",age =...
View ArticleBuilding xarray with dataframe columns as indices
I am working with a large dataset of named bridges, that each have several attributes. Some of the attributes are permanent, but several attributes are updated yearly. The data I received is a .csv...
View ArticleWhy does collecting inbound and outbound audio create distorted audio?
I'm trying to stream audio bytes into a shared buffer, and pass this through a transcription model. The audio's coming from a websocket sampled at 8kHz and mu-law encoded. I've managed to play a few...
View ArticlePython string formatting [duplicate]
I'm studying the code of an open source project. The code it's written in python and unfortunately I'm not so experienced with it. I found a lot of statement in the code like this:print "the string is...
View ArticleGetting the current output level on the volume speakers of individual windows...
I need to create a python program that will output the current volume of individual applications to the console. In the picture below, I highlighted in green the fluctuating scale, the level of which I...
View Articlelookup missing values from another dataframe in pandas
I have two dataframes.df1col1 var1 var2 var3X11 NA (for var3)X12 NA (for var2)X13 NA (for var1)df1 has a few columns (float64 type representing some categories) like var1, var2, var3 with values...
View ArticlePython while loop keeps asking endlessly for the same thing
I am trying to learn Python and I am still endlessly stuck with the same issue.In the exercise that I do, a user needs to insert coin of 5, 10 or 25 (nothing else) until he/ she reaches 50.But when I...
View ArticleGAE is very slow loading a sentence transformer
I'm using Google App Engine to host a website using Python and Flask.I need to add text similarity functionality, using sentence_transformers. In requirements.txt, I add a dependency to the cpu version...
View ArticlePython concepts for a class extending a dictionary
I've a database query that returns a dataset, which is naturally well represented by a dict. However I also need to add in metadata and other objects about it for other reasons. I also then need to be...
View ArticleDigit OCR using Tesseract
I'm trying to ocr some numbers:And I have made this code to test different psm arguments (6,7,8,13), I don't see much difference.import osimport pytesseractimport matplotlib.pyplot as pltimport...
View ArticleDataFrame structure conversion [duplicate]
I have a DataFrame with a structure and want to convert it to another structure.DataFrame before and afterI tried the pivot method but all I could see was NaN values.
View Articlewin32gui.EnumWindows starting with invalid window handle?
I have been using this piece of code I made for a few months now to check if a certain group of windows I have open are stuck on a certain window title for a given amount of seconds, and then closes...
View Articlelru_cache vs dynamic programming, stackoverflow with one but not with the other?
I'm doing this basic dp (Dynamic Programming) problem on trees (https://cses.fi/problemset/task/1674/). Given the structure of a company (hierarchy is a tree), the task is to calculate for each...
View Articlecmd command to run miniconda does not return an expected error-code in...
When starting a python script within miniconda, the %ERRORLEVEL% variable is set to 0, even after an error within the execution.C:\>call \ProgramData\miniconda\_conda.exe run --live-stream -p...
View ArticleSummarize all possible combinations in pandas dataset
I have table which represents sequence of points, I need to get sum by all possible combinations. The main problem is how to do it with minimum actions because the Real table is...
View ArticleCustom 2D Convolution not sharpening Image
I have written my own 2D Convolution function as followsdef TwoD_convolution(img, kernel): # Flipping the kernel by 180 degrees kernel = kernel[::-1] for i in range(len(kernel)): kernel[i] =...
View ArticleReturn more than 2 duplicates in each sublist (2d list)
I have a large 2d list that has duplicates in some sublists. I would like to return 2 or more duplicates and return the duplicates first if impossible. For instance,Df...
View Article