to_xlsx#

pycafee.normalitycheck.abdimolin.AbdiMolin.to_xlsx(self, file_name=None, sheet_names=None)#

This method exports the data to .xlsx.

This function is just a wraper around pd.DataFrame.to_excel [1] to export .xlsx files.

Parameters
file_namestr, optional

The name of the file to be exported, without its extension (default is None which results in a file name 'abdimolin.xlsx').

sheet_nameslist of two str, optional

A list containing the name of the worksheets where the data will be saved:

  • The first element corresponds to the name of the worksheet where the calculated data will be saved (default is None which means 'abdimolin').

  • The second element corresponds to the name of the worksheet where the supplied data will be saved (default is None which means 'data').

Returns
df_listA list of two pandas DataFrame

The first element is a pd.DataFrame with the AbdiMolin calculated data. The second element is a pd.DataFrame with the supplied data.

See also

fit

performs the AbdiMolin Normality test.

Notes

The fit() method needs to be applied beforehand.

If a spreadsheet with the same name already exists in the current directory and this file contains tabs with conflicting names, the new tabs will be inserted into the file with different names, preserving the original data.

References

1

pandas. pandas.DataFrame.to_excel function. Available at: pd.to_excel. Accessed on: 10 May 2022.

Examples

Export with default settings

>>> from pycafee.normalitycheck import AbdiMolin
>>> import numpy as np
>>> x = np.array([1.90642, 2.22488, 2.10288, 1.69742, 1.52229, 3.15435, 2.61826, 1.98492, 1.42738, 1.99568])
>>> abdimolin_test = AbdiMolin()
>>> abdimolin_test.fit(x)
>>> abdimolin_test.to_xlsx()
    The data has been exported to the 'abdimolin.xlsx' file

Download the exported file by clicking here.

Export with personalized file name

>>> from pycafee.normalitycheck import AbdiMolin
>>> import numpy as np
>>> x = np.array([1.90642, 2.22488, 2.10288, 1.69742, 1.52229, 3.15435, 2.61826, 1.98492, 1.42738, 1.99568])
>>> abdimolin_test = AbdiMolin()
>>> abdimolin_test.fit(x)
>>> abdimolin_test.to_xlsx(file_name="my_data")
    The data has been exported to the 'my_data.xlsx' file

Download the exported file by clicking here.

Export with personalized sheet name

>>> from pycafee.normalitycheck import AbdiMolin
>>> import numpy as np
>>> x = np.array([1.90642, 2.22488, 2.10288, 1.69742, 1.52229, 3.15435, 2.61826, 1.98492, 1.42738, 1.99568])
>>> abdimolin_test = AbdiMolin()
>>> abdimolin_test.fit(x)
>>> abdimolin_test.to_xlsx(file_name="abdimolin_test", sheet_names=["sample", "data"])
     The data has been exported to the 'abdimolin_test.xlsx' file

Download the exported file by clicking here.