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

Method toString

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

* Overrides default toString implementation. This essentially makes `print()` works.

()

Source from the content-addressed store, hash-verified

1977 * Overrides default toString implementation. This essentially makes `print()` works.
1978 */
1979 toString(): string {
1980 const maxRow = this.$config.getMaxRow;
1981 let indx: (string | number)[]
1982 let values = []
1983
1984 if (this.shape[0] > maxRow) {
1985 //slice rows to show [max_rows] rows
1986 const sfSlice = this.iloc([`0:${maxRow}`]);
1987
1988 indx = sfSlice.index
1989 values = sfSlice.values;
1990
1991 } else {
1992 indx = this.index
1993 values = this.values;
1994 }
1995
1996 const tabledata = values.map((x, i) => [indx[i], x])
1997 return table(tabledata as any);
1998 }
1999
2000 /**
2001 * Returns the logical AND between Series and other. Supports element wise operations and broadcasting.

Callers

nothing calls this directly

Calls 2

ilocMethod · 0.95
mapMethod · 0.65

Tested by

no test coverage detected