Reputation: 70
Have a table in a Markdown cell between 2 code cells, it is auto centering and I would like to to be on the left side of the cell like the text.
Here's the code:
Let's use the first row of `indices` to classify the 0th flower in `X_test`.
species | target
--- | ---
setosa | 0
versicolor | 1
virginica | 2
This cell prints the neighbor's position of closeness, index of the neighbor and that neighbor's `target` (Iris species).
Upvotes: 0
Views: 1839
Reputation: 18782
You can use Markdown
and display
to achieve such results. Here is the steps:
from IPython.core.display import Markdown
m0 = Markdown('''
Let's use the first row of `indices` to classify the 0th flower in `X_test`.
''')
m1 = Markdown('''
|species | target |
|-----------|:------:|
|setosa | 0 |
|versicolor | 1 |
|virginica | 2 |
''')
m2 = Markdown('''
This cell prints the neighbor's position of closeness, index of the neighbor and that neighbor's `target` (Iris species).
''')
To display, do this
display(m0,m1,m2)
Upvotes: 3