#!/usr/bin/env python # coding: utf-8 # In[ ]: flex_title = "Jupyter output data types" flex_author = "built using jupyter-flex" flex_source_link = "https://github.com/danielfrg/jupyter-flex/blob/master/examples/demos/data-types.ipynb" flex_include_source = True # # Markdown and images # ## Col 1 # ### Markdown # Text can be **bold**, _italic_, or ~~strikethrough~~. [Links](https://github.com) should be blue with no underlines (unless hovered over). # # Even LaTex expression work: $\delta_{\alpha}$. # # There should be whitespace between paragraphs. There should be whitespace between paragraphs. There should be whitespace between paragraphs. There should be whitespace between paragraphs. # # There should be whitespace between paragraphs. There should be whitespace between paragraphs. There should be whitespace between paragraphs. There should be whitespace between paragraphs. # # > There should be no margin above this first sentence. # > # > Blockquotes should be a lighter gray with a gray border along the left side. # > # > There should be no margin below this final sentence. # # # Header 1 # # This is a normal paragraph following a header. Bacon ipsum dolor sit amet t-bone doner shank drumstick, pork belly porchetta chuck sausage brisket ham hock rump pig. Chuck kielbasa leberkas, pork bresaola ham hock filet mignon cow shoulder short ribs biltong. # # ## Header 2 # # > This is a blockquote following a header. Bacon ipsum dolor sit amet t-bone doner shank drumstick, pork belly porchetta chuck sausage brisket ham hock rump pig. Chuck kielbasa leberkas, pork bresaola ham hock filet mignon cow shoulder short ribs biltong. # # ### Header 3 # # ``` # This is a code block following a header. # ``` # # #### Header 4 # # * This is an unordered list following a header. # * This is an unordered list following a header. # * This is an unordered list following a header. # # ##### Header 5 # # 1. This is an ordered list following a header. # 2. This is an ordered list following a header. # 3. This is an ordered list following a header. # # ###### Header 6 # # | What | Follows | # |-----------|-----------------| # | A table | A header | # | A table | A header | # | A table | A header | # # ---------------- # # There's a horizontal rule above and below this. # # ---------------- # # Here is an unordered list: # # * Salt-n-Pepa # * Bel Biv DeVoe # * Kid 'N Play # # And an ordered list: # # 1. Michael Jackson # 2. Michael Bolton # 3. Michael Bublé # # And an unordered task list: # # - [x] Create a sample markdown document # - [x] Add task lists to it # - [ ] Take a vacation # # And a "mixed" task list: # # - [ ] Steal underpants # - ? # - [ ] Profit! # # And a nested list: # # * Jackson 5 # * Michael # * Tito # * Jackie # * Marlon # * Jermaine # * TMNT # * Leonardo # * Michelangelo # * Donatello # * Raphael # # Definition lists can be used with HTML syntax. Definition terms are bold and italic. # #
#
Name
#
Godzilla
#
Born
#
1952
#
Birthplace
#
Japan
#
Color
#
Green
#
# # ---------------- # # Tables should have bold headings and alternating shaded rows. # # | Artist | Album | Year | # |-------------------|-----------------|------| # | Michael Jackson | Thriller | 1982 | # | Prince | Purple Rain | 1984 | # | Beastie Boys | License to Ill | 1986 | # # If a table is too wide, it should condense down and/or scroll horizontally. # # | Artist | Album | Year | Label | Awards | Songs | # |-------------------|-----------------|------|-------------|----------|-----------| # | Michael Jackson | Thriller | 1982 | Epic Records | Grammy Award for Album of the Year, American Music Award for Favorite Pop/Rock Album, American Music Award for Favorite Soul/R&B Album, Brit Award for Best Selling Album, Grammy Award for Best Engineered Album, Non-Classical | Wanna Be Startin' Somethin', Baby Be Mine, The Girl Is Mine, Thriller, Beat It, Billie Jean, Human Nature, P.Y.T. (Pretty Young Thing), The Lady in My Life | # | Prince | Purple Rain | 1984 | Warner Brothers Records | Grammy Award for Best Score Soundtrack for Visual Media, American Music Award for Favorite Pop/Rock Album, American Music Award for Favorite Soul/R&B Album, Brit Award for Best Soundtrack/Cast Recording, Grammy Award for Best Rock Performance by a Duo or Group with Vocal | Let's Go Crazy, Take Me With U, The Beautiful Ones, Computer Blue, Darling Nikki, When Doves Cry, I Would Die 4 U, Baby I'm a Star, Purple Rain | # | Beastie Boys | License to Ill | 1986 | Mercury Records | noawardsbutthistablecelliswide | Rhymin & Stealin, The New Style, She's Crafty, Posse in Effect, Slow Ride, Girls, (You Gotta) Fight for Your Right, No Sleep Till Brooklyn, Paul Revere, Hold It Now, Hit It, Brass Monkey, Slow and Low, Time to Get Ill | # # ---------------- # # Code snippets like `var foo = "bar";` can be shown inline. # # Also, `this should vertically align` ~~`with this`~~ ~~and this~~. # # Code can also be shown in a block element. # ``` # var foo = "bar"; # ``` # # Code can also use syntax highlighting. # ```javascript # var foo = "bar"; # ``` # # ``` # Long, single-line code blocks should not wrap. They should horizontally scroll if they are too long. This line should be long enough to demonstrate this. # ``` # # ```javascript # var foo = "The same thing is true for code with syntax highlighting. A single line of code should horizontally scroll if it is really long."; # ``` # # Inline code inside table cells should still be distinguishable. # # | Language | Code | # |-------------|--------------------| # | Javascript | `var foo = "bar";` | # | Ruby | `foo = "bar"` | # # ---------------- # # Small images should be shown at their actual size. # # ![](http://placekitten.com/g/300/200/) # # Large images should always scale down and fit in the content container. # # ![](http://placekitten.com/g/1200/800/) # # ``` # This is the final element on the page and there should be no margin below this. # ``` # ## Col 2 # ### Small JPEG # In[ ]: from IPython.display import display from IPython.display import Image # In[ ]: Image(url='http://placekitten.com/g/200/200', width=150) # ### Large JPEG # In[ ]: Image(url='http://placekitten.com/g/1200/1200') # # More images # ### Embeded image # In[ ]: img_url = 'http://www.lawrencehallofscience.org/static/scienceview/scienceview.berkeley.edu/html/view/view_assets/images/newview.jpg' Image(img_url, embed=True) # ### Small PNG # In[ ]: Image(url='http://www.vpdclub.com.au/images/running-dog.png', width=150) # ### Large PNG # In[ ]: Image(url='http://pngimg.com/uploads/dog/dog_PNG50361.png') # ## Col 2 # ### Small SVG # In[ ]: Image(url='https://www.w3docs.com/build/images/bw_chrome.svg', width=150) # ### Large SVG # In[ ]: Image(url='https://upload.wikimedia.org/wikipedia/commons/f/fa/Apple_logo_black.svg') # # HTML # ## Row 1 # ### Table # In[ ]: from IPython.display import HTML # In[ ]: s = """
Header 1 Header 2
row 1, cell 1 row 1, cell 2
row 2, cell 1 row 2, cell 2
""" h = HTML(s) display(h) # ### JS # In[ ]: from IPython.display import Javascript # You should have seen an alert when moving to this page, it came from this cell! # In[ ]: js = Javascript('alert("hi from the dashboard")') display(js) # ## Row 2 # ### Audio # In[ ]: from IPython.display import Audio # In[ ]: Audio(url="http://www.nch.com.au/acm/8k16bitpcm.wav") # ### Video # In[ ]: from IPython.display import YouTubeVideo # In[ ]: YouTubeVideo('sjfsUzECqK0') # # Others # ### Latex # In[ ]: from IPython.display import Latex # In[ ]: Latex(r"""\begin{eqnarray} \nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\ \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\ \nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\ \nabla \cdot \vec{\mathbf{B}} & = 0 \end{eqnarray}""") # ### JSON # In[ ]: from IPython.display import JSON # In[ ]: JSON({ "name": "Tester McTester", "age": 20, "location": "The North Pole", "job": { "title": "Senior Engineer", "employer": { "name": "Acme Inc.", "id": 1 } } }) # ## Row 2 # ### Stream # In[ ]: d = { "name": "Tester McTester", "age": 20, "location": "The North Pole", "job": { "title": "Senior Engineer", "employer": { "name": "Acme Inc.", "id": 1 } } } print(d) # ### Error trace # In[ ]: import pandos as pd # # iframe # In[ ]: from IPython.display import IFrame # In[ ]: IFrame("https://jupyter.org", width="99%", height="97%") # In[ ]: