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

Method query

src/danfojs-base/core/frame.ts:3250–3269  ·  view source on GitHub ↗
(condition: Series | Array<boolean>, options?: { inplace?: boolean })

Source from the content-addressed store, hash-verified

3248 **/
3249 query(condition: Series | Array<boolean>, options?: { inplace?: boolean }): DataFrame
3250 query(condition: Series | Array<boolean>, options?: { inplace?: boolean }): DataFrame | void {
3251 const { inplace } = { inplace: false, ...options }
3252
3253 if (!condition) {
3254 throw new Error("ParamError: condition must be specified");
3255 }
3256
3257 const result = _iloc({
3258 ndFrame: this,
3259 rows: condition,
3260 }) as DataFrame
3261
3262 if (inplace) {
3263 this.$setValues(result.values, false, false)
3264 this.$setIndex(result.index)
3265 } else {
3266 return result
3267 }
3268
3269 }
3270
3271 /**
3272 * Returns the data types for each column as a Series.

Callers

nothing calls this directly

Calls 3

_ilocFunction · 0.90
$setValuesMethod · 0.80
$setIndexMethod · 0.65

Tested by

no test coverage detected