tabular

Number formatting not working with tabulate after printing text

Number formatting not working with tabulate after printing text Question: I’m writing this little program learning Python and I have faced a problem. I use tabulate with number formatting set to 5 numbers after separator, to make everything look nice, and it works, until I print text in the table. After text is printed (stating …

Total answers: 2

python tabulating confusion matrix

python tabulating confusion matrix Question: In my sklearn logistic regression model, I obtained a confusion matrix using metrics.confusion_matrix command. The array looks like this array([[51, 0], [26, 0]]) Ignoring the fact that the model did pretty bad, I am trying to understand what is the best way to tabulate this matrix in pretty way I …

Total answers: 3

Formatting Text in a Table in Python

Formatting Text in a Table in Python Question: I’m having issues creating a table that is dynamic to adjust to various results. I’ve written a screen scraper to pull stocks from http://finance.yahoo.com and print the company name, it’s symbol, and it’s current stock price. However the output looks like this: Microsoft Corporation MSFT 29.76 Apple …

Total answers: 2

How to right-align columns content in reStructuredText simple tables?

How to right-align columns content in reStructuredText simple tables? Question: I’m editing the documentation for a project of mine using Sphinx, which in turn uses reStructuredText as markup language. I have a simple table (as opposed to grid table) in which the rightmost column reports contains numbers that I would like to right-align, but I …

Total answers: 5

How can I pretty-print ASCII tables with Python?

How can I pretty-print ASCII tables with Python? Question: I’m looking for a way to pretty-print tables like this: ======================= | column 1 | column 2 | ======================= | value1 | value2 | | value3 | value4 | ======================= I’ve found the asciitable library but it doesn’t do the borders, etc. I don’t need any …

Total answers: 13

BeautifulSoup: Get the contents of a specific table

BeautifulSoup: Get the contents of a specific table Question: My local airport disgracefully blocks users without IE, and looks awful. I want to write a Python scripts that would get the contents of the Arrival and Departures pages every few minutes, and show them in a more readable manner. My tools of choice are mechanize …

Total answers: 3