What version of Python is on my Mac?

You could have multiple Python versions on your macOS. You may check that by command, type or which command, like: Or type python in Terminal and hit Tab few times for auto completion, which is equivalent to: By default python/pip commands points to the first binary found in PATH environment variable depending what’s actually installed. So before installing Python packages with Homebrew, the default Python is installed in /usr/bin which is shipped … Read more

Plotting multiple different plots in one figure using Seaborn

One possibility would be to NOT use lmplot(), but directly use regplot() instead. regplot() plots on the axes you pass as an argument with ax=. You lose the ability to automatically split your dataset according to a certain variable, but if you know beforehand the plots you want to generate, it shouldn’t be a problem. Something like this:

matplotlib error – no module named tkinter

For Linux Debian based distros: RPM based distros: For windows: For Windows, I think the problem is you didn’t install complete Python package. Since Tkinter should be shipped with Python out of box. See: http://www.tkdocs.com/tutorial/install.html . Good python distributions for Windows can be found by the companies Anaconda or ActiveState. Test the python module p.s. I suggest … Read more

Mongoose: findOneAndUpdate doesn’t return updated document

Why this happens? The default is to return the original, unaltered document. If you want the new, updated document to be returned you have to pass an additional argument: an object with the new property set to true. From the mongoose docs: Query#findOneAndUpdate Available options new: bool – if true, return the modified document rather than the original. defaults to false (changed in 4.0) Solution Pass {new: true} if you … Read more