Skip to content

Is there a way to fix value-error problem

Hello guys i am trying to implement an algortihm to remove water from underwater images and make image more noticable , but i got an errror ValueError: max() arg is an empty sequence , at the function homomorpic on this line r = max(np.ravel(result[:,:i])) , the error is caused because the result array is emp…

Parsing JSON web scraper output

I am practicing web scraping using the requests and BeautifulSoup modules on the following website: https://www.imdb.com/title/tt0080684/ My code thus far properly outputs the json in question. I’d like help in extracting from the json only the name and description into a response dictionary. Code Desir…

Can you write to the middle of a file in python?

I would like to write to the middle of a line in a file. for exemple i have a file: Text.txt: Is is it possible to precise an index where: file.write() has to start writing? I have started with this: Answer I think what you can do is to substitute already existing characters with the same amount of other char…