I have a list of documents and this class to perform actions on that list. So, basically, morphed_documents is a list of strings. And at the end, the algorithm returns the cluster for each document. But why the results and model’s labels are not the same though? Answer K-Means algorithm starts with a ra…
How can I have my input be typed out again via using while loops and if statements?
So i have this simple problem and I am not so sure what to do even after trying it for quite sometime. my issue is that I am not so sure what to type such that my input user has to type either yes or no instead of typing something else. Additionally, when I tried to run the program, when
Plot a bar plot by using Seaborn
I am new in data visualization. I am practicing Seaborn and I am trying to plot a barplot with this dataframe. I want the chart has 3 bars on each symbol, however, the output has only 1 bar on each symbol. May I know how to fix it? Part of the DataFrame… The code like this: Output like this: Answer
Spitting a column based on a delimiter
I would like to extract some information from a column in my dataframe: Example I was using str.contain to extract the first part (i.e., all the information before the first dash, where there is. I am still getting the same original column (so no extraction). My output would consist in two columns, one withou…
Plotting average linear regression of data set consisting of missing values
I was trying to plot a linear graph using m,b = np.polyfit(x0, y0, 1) function however when I print m2,b2,m3,b3 I get nan. from the empty values. How do I fix this? Answer You seem to have a typo in It would probably help to rename the variables idxy12,idxy13 and idxy14 or so. You also could write all this wi…
How to add background image in Tkinter using OOP concept?
I am new to object oriented python programming. Currently I am using Python 3. I want to create an app which has multiple pages. I am able to navigate between pages but find it difficult to add image in the background. Please note I don’t want to know how to background image in tkinter as I am already a…
Python: generate 5 random int (every has own range) with fixed sum
Each value in Total has own range (in %). First: find random values (within ranges that is % from Total.). I tried this (but sum() can be >or< than 100): Second:find exact value for a,b,c,d,e (according to the percentage from Total in First part). I tried this: This code does not work. please help Answe…
ESP32 – combining two or more SDK example projects into one
tl;dr — how do I combine a pair of SDK projects together and have the “menuconfig” system work properly? I have a simple project in mind for an ESP32 module: Have the ESP32 provide a new dedicated WiFi network that allows a smart phone to connect directly to the ESP32. Once connected, the ph…
No module named certifi
When executing python3 (Python 3.6.8) script on a local directory, it works well, but when running sbatch job in slurm, complains about certifi. After adding to the python code this: or this: the same error occurs. It seems that certifi is installed. The error after running python code (without having the lin…
Pygame black screen crash [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 1 year ago. Improve this question I don’t what happened, it was working few minutes ago, but now itR…