I have some questions related to the program I wrote. The data I have is following To convert into a specific dictionary based on the number of columns provided, I use the strategy to write 2 functions. The first function is converting into a 2-dimensional list where 1st item of the 2d list provides the colum…
How to clear this AttributeError “nonetype”?
I’m learning datastructure while compiling this mergesort linkedlist . I got this error. I tried so much but didn’t work. Can any one tell me what’s wrong? please . Traceback (most recent call last): File “C:Users**AppDataLocalProgramsPythonPython37merge_sort_ver_2.0 linked list.pyR…
sqlite database didn’t update table in my flask webhook python code
I try to update my sqlite database using flask webhook. It seems commands line work fine if I type manually in the python console but my flask webhook didn’t update my SQLite database. It seems the apps fail at the “cursor.execute()” line. here is my webhook code: Can you please tell me what…
Why did multiprocessing giving me EOFError : Ran out of Input Error?
videoPlayerThreading is my own made library to basically making 2 class with each using threading to get and show frames. objDect is also my own library to basically return frame after object detection. I got EOFError : Ran out of Input error and from the traceback I think it is caused by the multiprocessing …
Python setlocale with empty string (default locale) gives “unsupported locale setting”
I’m getting the following error: The setup is a newly installed and updated Fedora 34 system with Python 3.9.6. The error occurs when running Lutris, and also when typing the commands into IDLE. Here is the exact backtrace from Lutris: Given that, according to the Python docs, “An empty string specifies the u…
Why is the button “Add” only working once?
I want to be able to use the button “Add” multiple times but at the moment it only works once. I only have pysimplegui imported. Heres part of the code because looks like i have a limit of characters or something. Hope I don’t have to wait 3 days again… Answer Your add_window closed af…
How do I melt a pandas dataframe?
On the pandas tag, I often see users asking questions about melting dataframes in pandas. I am gonna attempt a cannonical Q&A (self-answer) with this topic. I am gonna clarify: What is melt? How do I use melt? When do I use melt? I see some hotter questions about melt, like: Convert columns into rows with…
escaping square brackets from string in dataframe
I have a dataframe where i am try to clean the data from all cols. There are some annomalies in teh data like this: “[n], [ta], [cb]” basically anything in square brackets i want to ignore and replace with a space. I have this: this works except I still get the square brackets in the data but they…
Why are CMYK colors in Pillow out of 250 instead of 100?
CMYK color values are typically set as percentages out of 100, for example CMYK(100, 0, 70, 50) makes dark green. However it seems in Pillow one must multiply each value by 2.5 to get the same color. In the images below, the top and bottom “Hello World” text is set using the following code: For re…
Remove series of characters in pandas
Somewhat of a beginner in pandas. I am trying to clean data in a specific column by removing a series of characters. Currently the data looks like this: I need to remove the (F) I used … df[‘Column A’]=df[‘Column A’].str.replace(‘[(F)]’,’ ‘) This successfully removed the (F) but it also removed the other F le…