The Jupyter Notebook that runs on a PC has proportional fonts by default, so the output is jerky and inconvenient. Here are the steps to change this to a monospaced font. I have confirmed the operation on Mac.
Launch a terminal and execute the following command.
$ cd ~/.jupyter
$ mkdir custom
$ cd custom
$ echo '.CodeMirror pre, .output pre { font-family: Monaco, monospace; }' > custom.css
In this state
$ Jupiter notebook
Then the numpy matrix will also look nice as follows:
For your reference, the above code is a part of the training code of my book "Making a profitable AI with Python". If you are interested, please refer to the link below, including other codes.
https://github.com/makaishi2/profitable_ai_book_info/blob/master/refs/notebooks.md
Recommended Posts