I apologize for the length of this. I am a relative Neophyte to Excel VBA and even more junior with Python. I have run into an issue with an error that occasionally occurs in python using OpenPyXl (just trying that for the first time). Background: I have a series of python scripts (12) running and querying an…
Tag: python-3.x
GaussianProcessRegressor ValueError: array is too big; `arr.size * arr.dtype.itemsize` is larger than the maximum possible size
I am running the following code: The shape of my input is: (19142, 21) dtypes are each: float64 Added in Edit: X and y are Pandas Dataframes. After .values they’re each numpy arrays And I get the Error: ValueError: array is too big; `arr.size * arr.dtype.itemsize` is larger than the maximum possible siz…
I need a way to stop a function from running at the push of a button
I’ve been working on this for hours, and I’ve tried everything from break in an if statement to making an index variable. I can’t seem to find a way to stop the sound/music from playing. My goal is to press ‘Q’ and stop the function and while loop to start another while loop. Ans…
Python split function behaviour
returns This behaviour seems really strange to me. Why are blanks returned only for b and not a? Answer As was pointed out by others, the documented behavior of str.split explains your results. Since you specify sep to be ‘)’, split looks for the strings that surround it, and in the case of ‘…
AttributeError: module ‘socket’ has no attribute ‘setblocking’
I’m trying to use ‘non-blocked socket’ for a Python project (see previous question if anyone has a better answer : How to use a socket without waiting in python ) I saw that people on the site suggested using the command: socket.setblocking () But when I run the program it crashes, and the e…
I don’t get a print result of function when using range
Why can’t I see the result of the function when I use range()? I want to create a range of numbers where each the number will be evaluate in “colla” function. But range doesn’t work with “colla” Answer Your colla() function requires input numbers of 2 and above. Try this: P…
How to implement abstract classes over mulitple inheritances? [closed]
Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 1 year ago. Improve this question I have a question on multi level inheritance. I am trying to write cla…
TypeError: fit() missing 1 required positional argument: ‘y’,
I want to try out all regressors within the library. Since I do know, that some of the regressors require more input I build the try and expept catch block. This returns the following snipped many times: In my opinion there are two problems here. First, exept never gets called. Second, the y input is not reco…
Failed to struct.pack connection name in python
I try to use struct.pack but i get the next exception when i run it: the code that i run: I try to send the connection_struct as str and also as a bytes using encode. Answer The {name_len}s in your connection_struct specifies that you will pass {name_len} number of chars so when you call struct.pack() the las…
List has an issue
My code is: I want the output to be a list from my inputs. Why is the output [True, True, True] when there are three inputs before typing ‘quit’? Answer Looking at Operator precedence, the assignment operator := is the lowest of them all. That means that python evaluated the != first and assigned …