Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

list of lists to table python

In [22]: import pandas as pd
In [22]: pd.DataFrame(tableData).T # .T means transpose the dataframe
Out[22]:
          0      1      2
0    apples  Alice   dogs
1   oranges    Bob   cats
2  cherries  Carol  moose
3    banana  David  goose
#Remove those annoying numbers by setting columns and indices to blank:
In [27]: l1, l2 = len(tableData), len(tableData[0])
In [28]: pd.DataFrame(tableData, index=['']*l1, columns=['']*l2).T
Comment

PREVIOUS NEXT
Code Example
Python :: docstrings in python 
Python :: python seaborn violin plot 
Python :: python how to raise an exception 
Python :: stack more system in python 
Python :: pandas filter column with or 
Python :: include in flask 
Python :: iterate through a list and print from index x to y using for loop python 
Python :: quantile-quantile plot python 
Python :: python printing hello world 
Python :: python sum of array until index 
Python :: get unique words from pandas dataframe 
Python :: twitter api python 
Python :: python print values inside request.POST 
Python :: pandas aggregate dataframe 
Python :: isnumeric() in python 
Python :: Sum of Product 1 
Python :: python not in list 
Python :: df length 
Python :: how to download file using python using progress bar 
Python :: python machine learning model 
Python :: Python Tkinter Scale Widget 
Python :: how to check if a list is empty 
Python :: how to make a list in python 
Python :: concatenating strings in python 
Python :: python typing list of possible values 
Python :: merge dataframe using pandas 
Python :: Python recursively find files with specific ext 
Python :: how to speed up python code 
Python :: group by dataframe 
Python :: python logging level 
ADD CONTENT
Topic
Content
Source link
Name
3+8 =