Skip to content
Advertisement

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 empty but i filled it above

How do I get the sub-reddit submission with the highest score with pushshift?

I’m a beginner and I’m sorry if this is completely wrong. So far, I’ve been able to present the fields required (author, subreddit, date created, number of comments, score, submission title, submission description) as well as save this into a dataframe. But I’m suddenly lost when the complicated questions begin such as this one and which day of the week

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 Desired Output Answer You can parse the dictonary and then print a new JSON object using

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 characters

Unable to open pandas python package from Azure Data Studio, while configuring SQL Server 2019 Big Data Cluster

I’m working on setting up SQL Server 2019 Big Data Cluster. One of the initial steps is installing python package: panda. Post installation, when I try to import the package, I get the following exception in Azure Data Studio. import pandas ModuleNotFoundError: No module named ‘pandas’ I don’t get this exception, when I load the package from command-prompt/python. This could

Segmentation fault when importing a C++ shared object in Python

I have the following shared object: MyLib.cpp That I compile with: g++ -fPIC -shared -o MyLib.so MyLib.cpp I then use it with the following Python script: script.py Like this, it works perfectly, but if I uncomment the line //var = 10;, Python makes a segmentation fault (Python 3.8). This happens every time the object MyClass makes a change to one

Advertisement