MCPcopy Index your code
hub / github.com/javascriptdata/danfojs / describe

Method describe

src/danfojs-base/core/series.ts:892–911  ·  view source on GitHub ↗

* Generate descriptive statistics. * Descriptive statistics include those that summarize the central tendency, * dispersion and shape of a dataset’s distribution, excluding NaN values. * @example * ``` * const sf = new Series([1, 2, 3, 4, 5, 6]); * const sf2 = sf.

()

Source from the content-addressed store, hash-verified

890 * ```
891 */
892 describe(): Series {
893 if (this.dtypes[0] == "string") {
894 throw new Error("DType Error: Cannot generate descriptive statistics for Series with string dtype")
895 } else {
896
897 const index = ['count', 'mean', 'std', 'min', 'median', 'max', 'variance'];
898 const count = this.count();
899 const mean = this.mean();
900 const std = this.std();
901 const min = this.min();
902 const median = this.median();
903 const max = this.max();
904 const variance = this.var();
905
906 const data = [count, mean, std, min, median, max, variance];
907 const sf = new Series(data, { index: index });
908 return sf;
909
910 }
911 }
912
913
914 /**

Callers

nothing calls this directly

Calls 7

countMethod · 0.95
meanMethod · 0.95
stdMethod · 0.95
minMethod · 0.95
medianMethod · 0.95
maxMethod · 0.95
varMethod · 0.95

Tested by

no test coverage detected