Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #+BEGIN_SRC python :exports both :results verbatim
- import pandas as pd
- test = pd.DataFrame({'A': [1000, 1000], 'B' : [60, 100]})
- return test
- #+END_SRC
- #+RESULTS:
- : A B
- : 0 1000 60
- : 1 1000 100
- #+BEGIN_SRC python :exports both :results table
- import pandas as pd
- test = pd.DataFrame({'A': [1000, 1000], 'B' : [60, 100]})
- return test
- #+END_SRC
- #+RESULTS:
- | A B |
- | | A | B |
- | 0 | 1000 | 60 |
- | 1 | 1000 | 100 |
- test = pd.DataFrame({'A': [1000, 1000], 'B' : [60, 100]}, columns=list('AB'))
- test.columns.name = 'foo'
- #+RESULTS:
- : foo A B
- : 0 1000 60
- : 1 1000 100
- #+BEGIN_SRC python :exports both :results table
- import pandas as pd
- import numpy
- test = pd.DataFrame({'A': [1000, 1000], 'B' : [60, 100]})
- return test.as_matrix()
- #+END_SRC
- #+RESULTS:
- | 1000 | 60 |
- | 1000 | 100 |
- #+BEGIN_SRC python :exports both :results table
- import pandas as pd
- test = pd.DataFrame({'A': [1000, 1000], 'B' : [60, 100]})
- return [x.split(',') for x in test.to_csv().split('n')]
- #+END_SRC
- #+RESULTS:
- | | A | B |
- | 0 | 1000 | 60 |
- | 1 | 1000 | 100 |
- | | | |
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement