For 2D data objects in Python, you have 3 main options:
- Numpy Array
- Pandas DataFrame (built on np.array)
- SQL table
Numpy and Pandas are great for working with a complete set of data, but not very efficient for building up row by row.
SQL is good for building up the object row by row, but you have to write SQL and leave the world of Python objects.
PySimpleTable tries to find the middle ground with more flexibility than Numpy or Pandas for incrementally building a 2D object without needing to use SQL. Once the 2D object is created, call an included method to convert it to a more efficient and powerful Numpy Array or Pandas DataFrame for the real work.
A PySimpleTable has column headers names. Cells are referenced by:
tbl[row_num][col_num]
tbl[row_num]['colname']
Rows are added easily. Columns cannot be added or removed. Other features include:
- sorting by column(s)
- filter by function
- convert to Numpy Array or Pandas DataFrame
PySimpleTable
Lightweight Python 2D table object with column headers
Status: Beta
Brought to you by:
jim22k
Downloads:
0 This Week