to_csv#
- pycafee.normalitycheck.kolmogorovsmirnov.KolmogorovSmirnov.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
.csvfiles.- Parameters
- file_name
str, optional The name of the file to be exported, without its extension (default is
None, which results in a file named'kolmogorov_smirnov.csv')- sep
strof length 1, optional Field delimiter for the output file (default is
None, which uses the comma (',')). This is thesepparameter of thepd.DataFrame.to_csv()pandas method.
- file_name
- Returns
- df
pd.DataFrame A DataFrame containing the data used to export the
csvfile.
- df
See also
fitperforms the Kolmogorov Smirnov Normality test.
Notes
The
fit()method needs to be applied beforehand.If there is a file with the same name passed through the
file_nameparameter in the current directory, the file will be exported with a different name.References
Examples
Export with default settings
>>> from pycafee.normalitycheck.kolmogorovsmirnov import KolmogorovSmirnov >>> 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]) >>> ks_test = KolmogorovSmirnov() >>> ks_test.fit(x) >>> ks_test.to_csv() The 'kolmogorov_smirnov.csv' file was exported!
Download the exported file by
clicking here.Export with personalized file name
>>> from pycafee.normalitycheck.kolmogorovsmirnov import KolmogorovSmirnov >>> 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]) >>> ks_test = KolmogorovSmirnov() >>> ks_test.fit(x) >>> ks_test.to_csv(file_name="my_data") The 'my_data.csv' file was exported!
Download the exported file by
clicking here.