Skip to content

Close all variable explorer windows in Spyder

Does anyone know of a quick way to close all open variable explorer windows in Spyder? (i.e. the windows that open when you click on a variable). In Matlab, you can close all pop-up windows with close all. Does anything like that exist for Spyder? Answer (Spyder maintainer here) We don’t have a command …

Is there a fast way to shuffle numpy image in segments?

I want to write a function that can take small images and return a permutation of them, block-wise. Basically I want to turn this: Into this: There was an excellent answer in Is there a function in Python that shuffle data by data blocks? that helped me write a solution. However for ~50,000 28×28 images …

Fixing PATH for Python libraries using Bash

I am attempting to install some Python libraries by executing variations of the following command in Bash: I installed Python3 using Homebrew. I then get variations of the following message each time: WARNING: The scripts f2py, f2py3 and f2py3.7 are installed in ‘/Users/x/Library/Python/3.7/bin’ w…

How to restrict a geopandas plot by coordinates?

I created a simple geopandas map using a shape file from OpenStreetMap (link). Out: How can I restrict the plot to only a certain portion of the image, essentially zooming in on a certain location. Can I do this by specifying the extent of the portion of the map which I’d like to plot in latitude and lo…