davidbrochart / nbterm

Jupyter Notebooks in the terminal.
MIT License
745 stars 37 forks source link

Table rendering glitch #31

Open DavidMertz opened 3 years ago

DavidMertz commented 3 years ago

In viewing a Markdown table I get a garbled result:

            • Consistent doubled commas should be read as a single delimiter.
            • Missing data in the Favorite Color field should be substituted with the string <missing>.
            • Student ages should be between 9 and 14, and all other values are considered missing data.
            • Some colors are numerically coded, but should be unaliased.  The mapping is:

           | Number | Color    | Number | Color |:------:|:---------|:------:|---------- | 1      | beige
           | alabaster | 2      | eggshell | 7      | sandcastle | 3      | seafoam  | 8      | chartreuse
           mint     | 9      | sepia | 5      | cream    | 10     | lemon

           Using the small test data set is a good way to test your code.  But try also manually adding mo
           similar, or different, problems in them, and see how well your code produces a reasonable resul
           not discussed tools to accomplish this exercise yet, although you likely have used a programmin
           capable of solving it.  Try to solve it now, but you can come back to this after later chapters
           prefer.                                                                        

Tables rendered as Pandas DataFrame outputs look very nice in the same notebook. The example I tried is:

https://github.com/PacktPublishing/Cleaning-Data-for-Effective-Data-Science/blob/main/00-Preface.ipynb

DavidMertz commented 3 years ago

Oh

(cleaning3.9) 6236-cleaning-data [main|✔]
% nbterm --version
nbterm 0.0.7
(cleaning3.9) 6237-cleaning-data [main|✔]
% uname -a
Linux popkdm 5.11.0-7612-generic #13~1617215757~20.10~97a8d1a-Ubuntu SMP Thu Apr 1 21:09:17 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
(cleaning3.9) 6238-cleaning-data [main|✔]
% python --version
Python 3.9.2
davidbrochart commented 3 years ago

Markdown rendering is delegated to Rich, not sure what is going on.

sjvrijn commented 2 years ago

The markdown renderer used by Rich does not support tables: https://github.com/Textualize/rich/issues/1868#issuecomment-1036106767