When i try run code into Jupyter notebook i getting Import error(attached image). I add paths to PYTHON_PATH and add %PYTHON_PATH% in system PATH, but i still get thos error Answer If you are using Anaconda, you must know that it ignores PYTHONPATH!. Use the following commands: conda develop ~/models/research…
Method of class in module doesn’t see my globals()
I have a problem with globals using method of class from my testmodule Example: Text of my test module: cat ./testmodule.py Text of my test class the same: Text of my test func, nothing new: And go to test it. Everything is ready, let’s test Variable exist The same result, variable exist Variable is los…
Change np.seterr behavior inside a function only
I want to change the floating point error handling of numpy inside of a single function. Typical example: I would like the call to fto not change the output of np.seterr(), I have no idea how to do this. Thanks for any help ! Answer Use the numpy.errstate context manager to change floating-point error handlin…
Make Tkinter Notebook draggable
A similar question was asked back in ’15 Make Tkinter Notebook be Draggable to Another View but that was a while ago and that also asked about re-binding the window. I was wondering how I would make a notebook draggable, even if is just to reorder the tabs. Any advice would be helpful and please let me …
supposedly incorrect output np.reshape function
I have an array called “foto_dct” with shape (16,16,8,8) which means 16×16 matrices of 8×8. When I print foto_dct[0,15], being the last matrix of the first row I get: when i do foto_dct_big = np.reshape(foto_dct,(128,128)) and print foto_dct_big I get this: As you can see is the top righ…
Making a clustered bar chart
I have a little pandas dataframe that looks like this: Words (50) and the two columns with figures corresponding to every one of them signifying the incidence of the word. How do I make a clustered chart to show the comparison of the two figures for each word? I have tried virtually every piece of code that w…
Is it possible to use spacy with already tokenized input?
I have a sentence that has already been tokenized into words. I want to get the part of speech tag for each word in the sentence. When I check the documentation in SpaCy I realized it starts with the raw sentence. I don’t want to do that because in that case, the spacy might end up with a different toke…
How to embed machine learning python codes in hardware platform like raspberry pi?
I want to implement machine learning on hardware platform s which can learning by itself Is there any way to by which machine learning on hardware works seamlessly? Answer Python supports wide range of platforms, including arm-based. You raspberry pi supports Linux distros, just install Python and go on.
matplotlib: Can I use a secondary font for missing glyphs?
The font I want to use doesn’t have all the symbols I need. Is it possible to have matplotlib use a different font if a symbol is missing? Here is a minimal example: And the output: Noto Sans is missing the heart symbol while Noto Sans Symbols2 is missing the letters. I’m trying to get something l…
Formatting on save moves import statment in VS-Code
I am learning flask and building a app based on Corey Schafer’s Youtube tutorials. I’m using VS-Code as my editor of choice. In tutorial 5 he splits his app into a package structure and when I do it I run into a problem. In my settings I enabled the “editor.formatOnSave”: true and the …