larray.Session.to_excel

Session.to_excel(self, fname, names=None, overwrite=True, display=False, **kwargs)[source]

Dumps Array objects from the current session to an Excel file.

Parameters:
fname : str

Path of the file for the dump.

names : list of str or None, optional

Names of Array objects to dump. Defaults to all Array objects present in the Session.

overwrite: bool, optional

Whether or not to overwrite an existing file, if any. If False, file is updated. Defaults to True.

display : bool, optional

Whether or not to display which file is being worked on. Defaults to False.

Notes

  • each array is saved in a separate sheet
  • all session metadata is saved in the same sheet named __metadata__

Examples

>>> # axes
>>> a, b = Axis("a=a0..a2"), Axis("b=b0..b2")    # doctest: +SKIP
>>> # groups
>>> a01 = a['a0,a1'] >> 'a01'                    # doctest: +SKIP
>>> # arrays
>>> arr1, arr2 = ndtest((a, b)), ndtest(a)       # doctest: +SKIP
>>> s = Session([('a', a), ('b', b), ('a01', a01), ('arr1', arr1), ('arr2', arr2)])  # doctest: +SKIP
>>> # metadata
>>> s.meta.title = 'my title'                    # doctest: +SKIP
>>> s.meta.author = 'John Smith'                 # doctest: +SKIP

Save all arrays

>>> s.to_excel('output.xlsx')  # doctest: +SKIP

Save only some objects

>>> s.to_excel('output.xlsx', ['a', 'b', 'arr1'])  # doctest: +SKIP