Reputation: 4349
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...
Upvotes: 1
Views: 412
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:
Upvotes: 1