I don't know how this happens or why,
but I'll be in a jupyter notebook grouping by things and I will very conciously type in dataframe.groupby, write some other code and hit ctrl+ enter
and there will be that damn error. Every single time, I will go back and delete the 'groupyouby' and type in groupby.
I doubt that anyone has run into this error,and I don't know how long it will be until someone else creates the mess of libraries that I have that resulted in this chinese water tourture like nightmare. I am here, to let you know, that you are not alone.
Also if someone has a fix that would be great. I got nothing for you other than that description above.
Grammarly was the cause of this.
If you use jupyter notebooks and have the grammarly extension. It will cause problems.
Related
I've done something stupid in Python, in Jupyter notebook. I deleted the cell that had my functions in it, probably a couple of hours ago, and now I don't have them any more. However, I can still run them, so they are still loaded in the kernel.
Is there a way to find that loaded kernel somewhere so I could copy those functions back into my code?
Thanks!
I've looked on the internet for ideas but haven't found anything.
I found how to solve this. The .getsource does the work:
import inspect
lines = inspect.getsource(set_claims_rebates)
print(lines)
just started working on my quiz application using python and it has to do with maths(True-False) questions.So whenever i try to copy-paste a question from the internet to my questions array some characters are really messed up.Can anyone help me solve this please? i have searched a lot for a solution but didn't get an answer so far.(I am using Pycharm)
Sometimes there are space/tab conversion errors that occur when copy/pasting from a web source.
If that is the problem you're having in pycharm, just highlight the code that was copied > Edit > Convert Indents.
If this is not what you needed, please edit your question to include the code block containing the "really messed up characters" that you are seeing in pycharm. I'll try to see what's happening there.
I use Intellij IDEA for python, and it used to show every error I made on it. For some reason now, even if I do something that is clearly wrong, that check mark on the side always shows up. I tried fixing it, but that didn't work.
So this happens and I have tried retyping it the def statement. How can I fix this? I don't know when it started happening or why it happens but I know that I got it working once I think from restarting the program. This is python btw
https://i.stack.imgur.com/5A7kS.png
You should make sure your indentation is uniform (always 4 spaces). Starting with if Submit == "yes":, your lines have one extra space. This will be easier to do if you use a better IDE than IDLE, which will automatically highlight and label problems like this. Some good alternatives are Spyder (which is free), and PyCharm (which is free for students).
I am new to python programming... Just wanted to know does IDLE has a concept of 'executing selected statements'??
F5 runs the whole program... Is there any way to do this?
No, not now. Since you are at least the second person to ask this, I added the idea to my personal list of possible enhancements. However, while running a selection would not be a problem, producing accurate tracebacks for exception would be. Doing so is an essential part of Python's operation.
Currently, one can disable code that you need to not run by commenting it out (Alt-F3) or by making it a string. One can stop execution after a particular statement by adding 1/0. Or you can copy code to a new editor window.
Do you have a specific use case in mind, or are you just wondering?
Install Spyder, with its dependecies, and you will have wonderful FREE IDE !
You will have another solution, is to use IPython Notebook, where you will be able to use your Internet Browser to run python codes!: