to_csv#

pycafee.normalitycheck.andersondarling.AndersonDarling.to_csv(self, file_name=None, sep=',')#

Export the data to csv file This function is just a wraper around pd.DataFrame.to_csv [1] to export .csv files.

Parameters
file_namestr, optional

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

sepstr of length 1, optional

Field delimiter for the output file (default is None, which uses the comma (',')). This is the sep parameter of the pd.DataFrame.to_csv() pandas method.

Returns
dfpd.DataFrame

A DataFrame containing the data used to export the csv file.

See also

fit

performs the Anderson Darling Normality test.

Notes

The fit() method needs to be applied beforehand.

If there is a file with the same name passed through the file_name parameter in the current directory, the file will be exported with a different name.

References

1

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

Examples

Export with default settings

>>> from pycafee.normalitycheck.andersondarling import AndersonDarling
>>> 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])
>>> andersondarling_test = AndersonDarling()
>>> andersondarling_test.fit(x)
>>> andersondarling_test.to_csv()
    The 'andersondarling.csv' file was exported!

Download the exported file by clicking here.

Export with personalized file name

>>> from pycafee.normalitycheck.andersondarling import AndersonDarling
>>> 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])
>>> andersondarling_test = AndersonDarling()
>>> andersondarling_test.fit(x)
>>> andersondarling_test.to_csv(file_name="my_data")
    The 'my_data.csv' file was exported!

Download the exported file by clicking here.