Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

jupyter notebook fancy print cross tab

#### credit to user in StackOverflow (see source link)
#### works also with pd.crosstab

from tabulate import tabulate
import pandas as pd

df = pd.DataFrame({'col_two' : [0.0001, 1e-005 , 1e-006, 1e-007],
                   'column_3' : ['ABCD', 'ABCD', 'long string', 'ABCD']})
print(tabulate(df, headers='keys', tablefmt='psql'))

+----+-----------+-------------+
|    |   col_two | column_3    |
|----+-----------+-------------|
|  0 |    0.0001 | ABCD        |
|  1 |    1e-05  | ABCD        |
|  2 |    1e-06  | long string |
|  3 |    1e-07  | ABCD        |
+----+-----------+-------------+
Comment

PREVIOUS NEXT
Code Example
Python :: tensorflow albumentations object detection 
Python :: i for i 
Python :: get derivative of interp1d 
Python :: compute mean over y for same x numpy 
Python :: read stripped lines from a file python 
Python :: how to get list from comma separated string in python 
Python :: columnspan vs column tkinter 
Python :: os get directory from string 
Python :: python list comprehension with filter example 
Python :: print g 
Python :: *args **kwargs together in python 
Python :: ipython widget display 
Python :: TemplateSyntaxError 
Python :: jetson nx unable to install matplotlib 
Python :: sklearn random forest feature importance 
Python :: input date args python datetime 
Python :: add colorbar to 2d hist 
Python :: c++ to python code converter 
Python :: JEW token authentication in Django UTC 
Python :: i=int(input("enter the number")); sum=0; pro=1; while(i0): d=1%10; if (d%2==0): sum=sum+d; else: pro=pro*d; i=i//10; print("sum=",sum,"product=",pro); 
Python :: how to add base map in pyqgis 
Python :: python code for diamond with gap between odd rows 
Python :: Python Split list into chunks using lambda Method 
Python :: convert integer unix to timestamp python 
Python :: python n periods of std 
Python :: how to get device hwid cmd 
Python :: Dynamically limiting queryset of related field 
Python :: python does strftime work with date objects 
Python :: deezer python download 
Python :: the grandest staircase of them all foobar solution 
ADD CONTENT
Topic
Content
Source link
Name
3+8 =