E.K.
E.K.

Reputation: 4349

Create a table containing pipes on ipython notebook

When I create a table in ipython notebook, how can I escape pipes inside of text.

This is what I have

identifier | class name | args | distance function
------------|------------------|-------------------
“euclidean” | EuclideanDistance | | sqrt(sum((x - y)^2))
“minkowski” | MinkowskiDistance |p| `sum(|x - y|^p)^(1/p)`

It comes out as like below but obviously sum(|x - y|^p)^(1/p) is a formula and all the texts need to stay together...

enter image description here

Upvotes: 1

Views: 412

Answers (1)

cchi
cchi

Reputation: 1141

Use the escaped pipe version | to display the pipe characters properly when table is rendered for ipython notebook markdown cells.

identifier | class name | args | distance function
------------|------------------|-------------------
“euclidean†| EuclideanDistance | | sqrt(sum((x - y)^2))
“minkowski†| MinkowskiDistance |p| sum(|x - y|^p)^(1/p)

*make sure you get rid of the tick marks.

Outcome in notebook should display as such:

ipython markdown - table containing pipes

Upvotes: 1

Related Questions