MCPcopy Create free account
hub / github.com/javascriptdata/danfojs / dt

Method dt

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

* Returns time class that exposes different date time method * @example * ``` * const sf = new Series([ * "2020-01-01", * "2020-01-02", * "2020-01-03", * "2020-01-04", * "2020-01-05", * ]); * const sfd = sf.dt.dayOfWeekName(); *

()

Source from the content-addressed store, hash-verified

1966 * ```
1967 */
1968 get dt() {
1969 if (["string", "datetime"].includes(this.dtypes[0])) {
1970 return new Dt(this)
1971 } else {
1972 throw new Error("Cannot call accessor dt on non-string type");
1973 }
1974 }
1975
1976 /**
1977 * Overrides default toString implementation. This essentially makes `print()` works.

Callers

nothing calls this directly

Calls 1

includesMethod · 0.80

Tested by

no test coverage detected