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

Method constructor

src/danfojs-base/core/series.ts:52–74  ·  view source on GitHub ↗
(data: any = [], options: BaseDataOptionType = {})

Source from the content-addressed store, hash-verified

50export default class Series extends NDframe implements SeriesInterface {
51
52 constructor(data: any = [], options: BaseDataOptionType = {}) {
53 const { index, columns, dtypes, config } = options;
54 if (Array.isArray(data[0]) || utils.isObject(data[0])) {
55 data = utils.convert2DArrayToSeriesArray(data);
56 super({
57 data,
58 index,
59 columns,
60 dtypes,
61 config,
62 isSeries: true
63 });
64 } else {
65 super({
66 data,
67 index,
68 columns,
69 dtypes,
70 config,
71 isSeries: true
72 });
73 }
74 }
75
76 /**
77 * Purely integer-location based indexing for selection by position.

Callers

nothing calls this directly

Calls 2

isObjectMethod · 0.80

Tested by

no test coverage detected