just trying to save websockets to CSV’s. But it just doesnt make the file. Nothing in the directory. Tried running VScvode as admin, moving folder out of C: drive to documents .. nothing. no csv file, and no error. and no information on the internet about this either. So i kept stripping down the code t…
Tag: python
How to install an umerged pull request with pip?
I’ve tried the solutions from here but can’t get them working. pip install deap installs the python2 version of deap on my RPi4b for some reason, even with python3.10 installed, as evident by some syntax errors. I see that there is a pull request that has the 2 to 3 conversions done in the files a…
Generating all possibilities of a string given a list of chars but want only the strings up to n length
I have written the below code to recursively generate all of the possible combinations of a string. However I want to only produce all the possibilities of the string up to a length of n. Say the string is ‘abc’, and n=2. Instead of outputting all of the possible strings of ‘abc’ I onl…
how to sum values in column based on names reported in another column and report which name does not match the expected target? [closed]
Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 7 months ago. Improve this question how …
How to take the item from string and use it as a value
I have a string and I need to use this string to fit a model. However when I try try to do this, of course it raises an error which can be seen below. How can I use this string to fit the model? Answer You need to evaluate the string into a Python object, ie do See documentation of
Convert items of a list of lists with different format conversion
I have the following list of lists (denoted by lol): I am trying to convert lol in such a way that each first three strings of a sub-list to be converted to int and each last string of the same sub-list to be converted to datetime (dateConverter() is to convert string to daytime). I am expecting to have as ou…
print strings of one dataframe contained in another dataframe
I have two dataframes: one dataframe consists of two columns (‘good’ and bad’) and another one that contains text data. Now I would like to retrieve exact string matches of words that are in the dictionary and are contained in col1 of df_text and assign the string match to the second column …
Changing a cell value in a columns based on a query from two other columns
I have a DataFrame with four columns: “date”, “time_gap”, “count” and “average_speed”. I’d like to set values to the count column when requirements are met based on the “date” and “time_gap” columns. So, for example, if I’m ru…
How can I get coloredlogs in PyCharm Python Console to format properly?
My logging setup is: If I configure the console to use python for output, all lines start at column 0, but all output is red. But if I specify use terminal, the colors are there, but the lines don’t start at column 1. They all start with the end column of the line before. How can I get all log
Turtle only completes one iteration of a loop and stops at done()
I am trying Python turtle and I am facing this error: Here is my code: Answer The problem is calling done() in the loop. Let’s check the docs for this function: turtle.done() Starts event loop – calling Tkinter’s mainloop function. Must be the last statement in a turtle graphics program. Mus…