i am a student just starting out with python, and i was tasked with creating a relational database management system. I think i came pretty far, but i seem to have hit a wall. This is my code: when i run it with line 4 directing the input towards :memory: it works perfectly and i have myself what i think
The Python executable is not recognized on Windows 10
I recently installed Python 3.6.3 on my device. When I type python in my cmd window, it gives me this error. I do have the PATH in the environment variables. Path Lists. This should normally fix it, but python is still not recognized. Answer The path to the Python executable needs to be in the System PATH var…
Mapping RGB values in an image to a corresponding ID using a dictionary
I am working on a segmentation problem where given an image, each RGB value corresponds to a class label. The problem I have is to efficiently map RGB values from an image (numpy array) to a corresponding class label image. Let’s provide the following simplified example: (in a real example the colorIdMa…
Cant exit fullscreen on tkinter window python
Im trying to make this window fullscreen, then be able to escape with any key. I can’t bind the escape key to actually escaping the window, can’t figure out where it’s going wrong from other similar posts too. Here is the code: Answer On some systems (like Linux) root.overrideredirect(True) …
Pandas rolling window to return an array
Here is a sample code. Output: I want my ‘C’ column to be an array like [0.1231, -1.132, 0.8766]. I tried using rolling apply but in vain. Expected Output: Answer You could use np.stride_tricks:
Getting a list of all known classes of vgg-16 in keras
I use the pre-trained VGG-16 model from Keras. My working source code so far is like this: I wound out that the model is trained on 1000 classes. It there any possibility to get the list of the classes this model is trained on? Printing out all the prediction labels is not an option because there are only 5 r…
Running a python script on Google Cloud Compute Engine
For a machine learning task at school I wrote my own MLP network. The data set is quite big, and training takes forever. I was alerted to the option of running my script on the Google Cloud Compute Engine. I tried to set this up, but did not succeed (yet). The steps I undertook where: Create an account Create…
Kmean clustering top terms in cluster
I am using python Kmean clustering algorithm for cluster document. I have created a term-document matrix Then I applied Kmean clustering using following code My next task is to see the top terms in every cluster, searching on googole suggested that many of the people has used the km.cluster_centers_.argsort()…
Equidistant points between two points?
I am trying to know equidistant points between two points. For example: The answer that I am expecting is: In this example, with p1, and p2: Always will be a straight line. HowManyParts in this case is the whole distance that is divided something like numpy.linspace() but in two dimensions. Answer Thanks to l…
Draggable lines select one another in Matplotlib
I’m trying to create a class of draggable lines using matplotlib handling and picking. The aim is to set different thresholds and intervals on a graph. Here is the code: The behavior is what I expected when using only 1 line (even if it notify the selection also when I release the line). When I’m …