Category "python"

Scraping users from Telegram failed

I trying to run below python program to scrape the member however i encounter error below.can anyone pls advise what wrong with code or due to bug? Traceback (

ValueError: could not convert string to float: '<kivy.uix.textinput.TextInput object at 0x0000011D49678430>'

I'm new at python and right now i try to make similar calculator with user input. I rewrote my code but its still dont work fine. Cant convert string property t

create dataframe as week and their weekly sum from dictionary of datetime and int

I have datetime and int values dictionary like below. details = { datetime.datetime.strptime("04-01-2021", "%d-%m-%Y") : 15, datetime.datetime.strptime(

How to send multiple files with Python requests to FastAPI server?

I have the following endpoint in my FastAPI server: @app.post("/submit") async def submit(file1: List[UploadFile] = File(...), file2: List[UploadFile] = File(..

Linking python and c++ on windows

I'm trying to create a python library, written in c++, using boost-python, and mingw to compile. c++ Code: char const* greet() { return "hello, world"; } #i

Looking to create a script to decrypt password protected PDF files

I have multiple directories of password protected PDF files and I'm looking to decrypt all of these files and save the resulting decrypted file as a new file in

Concatenate images from folders by their ORDER in python

I know how to concatenate two exact images, but I need to combine two images each from their own folder. I cannot do it by name of the image or don´t know

Matching vocabulary elements to indices from LDA Model using PySpark

I'd like to take a Spark LDA Model's term indices from the .describeTopics() output and match them to the appropriate term in the count vectorizer's vocabulary.

confusion with cppyy for overloaded methods and error handling

I have a c++ class with several constructors: MyClass(const std::string& configfilename); MyClass(const MyClass& other); I have python bindings for thi

Plotting border of masked array with plt.imshow

Actually plotting this image using plt.imshow and np.masked to plot the figure in blue. I would like to remove the inner part of the figure and just leaving the

tensorflow keras fit not showing any information

When using model.fit(), I only see the text "Epoch 1/10", and after a few seconds, it shows "Finished" with exit code: -1073740791 status: 1. My labels are a on

Reasonable neighbours for a bees algorithm on a not-complete digraph

I am trying to solve an optimization problem for a graph, where basically there is a cost for transporting "package" over a single edge, and I have multiple sou

Preparing data for Gephi with Python or R

I am currently trying to prepare my data for network analysis in Gephi. I have data in the following format: Raw Data SHIPMENTCOUNT US Port Foreign Initial Po

How do I import a full package but still call specific methods from a package directly?

I'm trying to both a module and an import from a module. I've been using from time import sleep for a few years now, but I'm wanting access to more of the featu

Gunicorn + Flask + Docker python app hosted on Azure Container Instances returns SystemExit: 1

I deployed a web app on GPU enabled ACI (Azure Container Instance) using Gunicorn + Flask + Docker. This app runs a couple of pytorch models (one of them being

python module installation error when deploying a Django application on heroku

I am deploying my django application on heroku. but when installing the modules from the requirement.txt file, it returns an error on the "Paydunya" module. I a

How to do exact one-to-one match validation with pydantic model schema?

How can I exactly match the Pydantic schema? The suggested method is to attempt a dictionary conversion to the Pydantic model but that's not a one-one match. I

DataBricks Python unit test error help needed

I have a problem with unit testing in DataBricks. I have not found any similar error message yet. Could someone please help me? Below you can find my code: impo

Dataframe transformation by taking month columns into rows

The original dataframe is as follows: And I would like to change it into this way:

How do I insert a row every nth row in openpyxl?

I have a workbook in which I get data from a program and I was trying to automate some of the tasks, Basically there is data for a game every 4 rows and it goes