API into Fast API Framework
How can i enhance my python skill to write API into FAST API framework as a beginner?Things are new for me.My Tl is expecting to write API as soon as possible.STUCKED.............Pls...
View ArticleC# start python process which listens to StandardInput
I'm using Process.start() in python to start a python script. In general this works, but I have a problem concerning the performance when starting the python script.The process is as follows:C# starts...
View ArticleTensorflow2.2.0 ValueError: Sliced assignment is only supported for variables
I'm trying to update cache while training a UNet. I'm rewriting some function from tf=2.13.0 to 2.2.0 because the latter is the only available version on my GPU cluster.Ubuntu 20.04Python...
View ArticleWhat is the command line argument for virtual enviroment paths?
To run a certain script in crontab, I used to have python3 /path/to/script in my crontab entries. This script requires one package from pip, the Python package manager.Recent updates to Python...
View Article'if' command is interfering with another line of code [duplicate]
Im creating a crafting code and introduced a 'store' system where you buy materials, I also made a code that reverts to the starting line of code if you don't put in something right, but for some...
View ArticleFitting an ODE model to infection data from an agent-based simulation
I am trying to fit a Susceptible-Infectious-Recovered (SIR) ODE model to infection data in python using scipy.optimize, but the infection curve of the ODE model leads to a delayed rise in infections...
View ArticleCustom cropping function in ImageDatagenerator
I need to Crop a square shape around a Centre point (x,y) and I try to create my custom function below.from PIL import Imagedef Crop_Image(image): cropsize = 224 croplength = cropsize/2 x = Xcentre y =...
View ArticleHow to modify patches made by patchify?
I am using patchify library to patch a big image:img = cv2.imread("resized.jpg")patches_img = patchify(img, (224,224,3), step=224)print(patches_img.shape)Then I save the patches:for i in...
View ArticleProblem compiling dll files with CUDA FFT package (Windows 64)
I'm trying to compile some dll files with some c++ and CUDA functions to quickly process some data that I receive in a python program (160MB/s from an acquisition card to be FFT). The DLL works fine...
View ArticlePythonic way to resolve circular import statements?
I just inherited some code which makes me uneasy: There is a testing library, full of classes corresponding to webpages on our site, and each webpage class has methods to automate the functionality on...
View ArticleWhy does PyImport_Import fail to load a module from the current directory?
I'm trying to run the embedding example and I can't load a module from the current working directory unless I explicitly add it to sys.path then it works:PyRun_SimpleString("import...
View ArticleHow to read scalar, vector and matrix information in string format resembling...
I have strings that contain scalars, vectors, and matrices, e.g."[0,1],[[1,2],[3,4]],42"And following the same example, that input in R should give me this:[[1]][1] 0 1[[2]] [,1] [,2][1,] 1 3[2,] 2...
View Articleget data from ECU - issue with FD
I'm trying to get information from the ECU. The connection works, and I see that the request has been sent but I don't receive any information. Because the application (which is burned in the unit and...
View ArticleTkextrafont can't find font file in compiled program
In my project i using tkextrafont.Font(file="resources/fonts/cs_regular.ttf")In IDE my program successfully working, but i starting compiled program i see this problem:WinError[2] Сannot find the...
View ArticleHow to solve no unicode mapping error from PDFBox?
I have an existing PDF file that I would like to convert to excel file using python script. Currently using PDFBox, however there are multiple errors similar to the...
View ArticleDownload PDF to a Specific Location on Button Press
from flask import Flask, render_template, request, send_filefrom werkzeug.utils import secure_filenamefrom pdf2docx import Converterapp = Flask(__name__)@app.route('/to-doc', methods=['POST',...
View ArticleProblem with mapping codes to county names in Python | Pandas [duplicate]
I have a dataset containing almost 400 counties from Poland. I need to merge several files containing data related to these counties. Each county is identified by its name and a code. However, there's...
View ArticleGetting "CatBoostError: Attempt to call single feature writer on packed...
When I try to fit CatBoostClassifier on GPU with pandas dataframe with embeddings, I get this error:CatBoostError: Attempt to call single feature writer on packed feature writerThe data type for...
View Article3D plot using three 1D arrays Python
I have three 1D NumPy Arrays XX, YY, and ZZ. They are organized such that ZZ[i] is the height of a hill at coordinates XX[i], YY[i]. How can I plot this using Python?Edit:The arrays are quite large...
View ArticlePython / Django deploy issue on Heroku
I am trying to deploy a Python / Django app for a class project and been told I have to use Heroku, which I don't like at all!Initially when I tried to push to heroku using the cli git push heroku...
View Article