Search code examples
pythonjupyter-notebookwidgetipythonipywidgets

How to add column names to ipysheet without using pandas data frame?


Here we are getting by default A,B as column names, how to override column names and write our own column names

import ipysheet
from ipysheet import sheet, cell
sheet1 = sheet()
cell(0,0,10);
cell(1,1,100);
cell(2,2,1000);
cell(3,3,"Hello");
sheet1

Solution

  • You can write your own column names for a sheet when you are creating it. You can use the column_headers argument for this.

    In your case:

    import ipysheet
    from ipysheet import sheet, cell
    sheet1 = sheet(column_headers=["Not A", "Not B"])
    cell(0,0,10);
    cell(1,1,100);
    cell(2,2,1000);
    cell(3,3,"Hello");
    sheet1