I would like to make a graph using seaborn. I have three types that are called 1, 2 and 3. In each type, there are groups P and F. I would like to present the graph in a way that each bin sums up to 100% and shows how many of each type are of group P and group F.
Tag: python-3.x
topic modeling error (doc2bow expects an array of unicode tokens on input, not a single string)
I am trying to remove stop words using a separate txt file which contains stop words. And after I remove the stop words I am appending words of the text file which is not there in the stop words. I am getting the error doc2bow expects an array of unicode tokens on input, not a single string at dictionary =
When using the method while, it throws an error Name error [closed]
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers. Closed 1 year ago. Improve this question
Why does the following code is giving an answer that is very far from the analytic answer?
I am trying to learn Python and I came across the following question: “A ball is dropped straight down from a cliff with height h. The position of the ball after a time t can be expressed as: y(t) = v0*t − (at^2)/2 + h where a is the acceleration (in m/s^2) and v0 is the initial velocity of the
How is the initialization of objects considered in this code?
In this class there is no attribute called “a” then how x.a is considered ? Similarly what is “x.a.b”, “x.a.b.c”, “x.a.b.c.d”, “x.a.b.c.d.e” and how are they considered ?Is b is an attribute of x.a in the case of “x.a.b” and c is a attribute of x.a.b in the case of “x.a.b.c” ? Explain breifly !!! I am totally confused 😵
How to mock subsequent function calls in python?
I’m new to testing and testing in python. I have a python class that looks like this : File name : my_hive.py I want to mock these functions : pyhive.hive.connect, pyhive.Connection.cursor(used by my class as hive.connect(hive_ip).cursor()) and pyhive.Cursor.execute (used by my class as self.cursor.execute(command) in execute method). I’m able to mock function call hive.connect and also I have been able
How to stop Recursion and return answer?
This is a sudoku solver function and I have 2 questions: Why 2nd print print the original sudoku? How can I get the sudoku solution (not print it), because I want to reuse the solution. (I have tried using return sudoku but get None) Thanks:) Answer Maybe it is not elegant but I use global list all_solutions and append duplicated
How to add QAction to QLineEdit in pyqt5?
I am making an application in pyqt5 in which I have to add QAction to QLineEdit. I have tried many times but failed. This is what I want Please help me. Thank you in advance Answer Here is a very basic example:
ImportError: cannot import name ‘gen’ from ‘tornado’ (unknown location)
I am trying to reinstall pip in my Mac. However, I am still running into the following error. I tried to fix it by deleting pip, but even when I try to reinstall it, the same problem keeps occurring. Maybe anyone has a solution on how to fix this problem. Answer I had the same problem, so I uninstalled Python
How to use __get__ and __set__ (python descriptors)
I’m new to using descriptors and I think I have a good understanding on how they work but I have come across a problem and i’m not sure how to fix it. Code Output Im trying to make bar a constant for testing purposes, I know about the property decorator but I prefer using descriptors. First I print out the