@@ -511,7 +511,37 @@ export interface Bincode<T> {
511
511
* Functions that can be applied to dtype List
512
512
*/
513
513
export interface ListFunctions < T > {
514
+ /**
515
+ * Retrieve the index of the minimal value in every sublist.
516
+ * @returns Expression of data type :class:`UInt32` or :class:`UInt64`
517
+ * @example
518
+ * --------
519
+ * ```
520
+ * const s0 = pl.Series("a", [[1, 2], [2, 1]]);
521
+ * s0.lst.argMax();
522
+ * Series: 'a' [u32]
523
+ * [
524
+ * 0
525
+ * 1
526
+ * ]
527
+ * ```
528
+ */
514
529
argMin ( ) : T ;
530
+ /**
531
+ * Retrieve the index of the maximum value in every sublist.
532
+ * @returns Expression of data type :class:`UInt32` or :class:`UInt64`
533
+ * @example
534
+ * --------
535
+ * ```
536
+ * const s0 = pl.Series("a", [[1, 2], [2, 1]]);
537
+ * s0.lst.argMax();
538
+ * Series: 'a' [u32]
539
+ * [
540
+ * 1
541
+ * 0
542
+ * ]
543
+ * ```
544
+ */
515
545
argMax ( ) : T ;
516
546
/**
517
547
* Concat the arrays in a Series dtype List in linear time.
@@ -541,6 +571,7 @@ export interface ListFunctions<T> {
541
571
/**
542
572
* Check if sublists contain the given item.
543
573
* @param item Item that will be checked for membership
574
+ * @param nullBehavior - bool, default True If True, treat null as a distinct value. Null values will not propagate.
544
575
* @example
545
576
* --------
546
577
* ```
@@ -561,7 +592,7 @@ export interface ListFunctions<T> {
561
592
* ```
562
593
* @category List
563
594
*/
564
- contains ( item : any ) : T ;
595
+ contains ( item : any , nullBehavior ?: boolean ) : T ;
565
596
/**
566
597
* Calculate the n-th discrete difference of every sublist.
567
598
* @param n number of slots to shift
@@ -582,22 +613,30 @@ export interface ListFunctions<T> {
582
613
diff ( n ?: number , nullBehavior ?: "ignore" | "drop" ) : T ;
583
614
/**
584
615
* Get the value by index in the sublists.
585
- * So index `0` would return the first item of every sublist
586
- * and index `-1` would return the last item of every sublist
587
- * if an index is out of bounds, it will return a `null`.
616
+ * @param index - Index to return per sublist
617
+ * @param nullOnOob - Behavior if an index is out of bounds:
618
+ * True -> set as null
619
+ * False -> raise an error
620
+ * @example
621
+ * -------
622
+ * ```
623
+ * const s0 = pl.Series("a", [[1, 2], [2, 1]]);
624
+ * s0.lst.get(0);
625
+ * Series: 'a' [f64]
626
+ [
627
+ 1.0
628
+ 2.0
629
+ ]
630
+ * ```
588
631
* @category List
589
632
*/
590
- get ( index : number | Expr ) : T ;
633
+ get ( index : number | Expr , nullOnOob ?: boolean ) : T ;
591
634
/**
592
635
* Run any polars expression against the lists' elements
593
636
* Parameters
594
637
* ----------
595
638
* @param expr
596
639
* Expression to run. Note that you can select an element with `pl.first()`, or `pl.col()`
597
- * @param parallel
598
- * Run all expression parallel. Don't activate this blindly.
599
- * Parallelism is worth it if there is enough work to do per thread.
600
- * This likely should not be use in the groupby context, because we already parallel execution per group
601
640
* @example
602
641
* >df = pl.DataFrame({"a": [1, 8, 3], "b": [4, 5, 2]})
603
642
* >df.withColumn(
@@ -617,7 +656,7 @@ export interface ListFunctions<T> {
617
656
* └─────┴─────┴────────────┘
618
657
* @category List
619
658
*/
620
- eval ( expr : Expr , parallel ?: boolean ) : T ;
659
+ eval ( expr : Expr ) : T ;
621
660
/**
622
661
* Get the first value of the sublists.
623
662
* @category List
@@ -797,7 +836,7 @@ export interface DateFunctions<T> {
797
836
*/
798
837
second ( ) : T ;
799
838
/**
800
- * Format Date/datetime with a formatting rule: See [chrono strftime/strptime](https://docs.rs/chrono/0.4.19 /chrono/format/strftime/index.html).
839
+ * Format Date/datetime with a formatting rule: See [chrono strftime/strptime](https://docs.rs/chrono/0.4.41 /chrono/format/strftime/index.html).
801
840
*/
802
841
strftime ( fmt : string ) : T ;
803
842
/** Return timestamp in ms as Int64 type. */
0 commit comments