./../api/polars.exceptions.SchemaError.html)
    * [ polars.exceptions.SchemaFieldNotFoundError ](../../api/polars.exceptions.SchemaFieldNotFoundError.html)
    * [ polars.exceptions.ShapeError ](../../api/polars.exceptions.ShapeError.html)
    * [ polars.exceptions.StructFieldNotFoundError ](../../api/polars.exceptions.StructFieldNotFoundError.html)
    * [ polars.exceptions.TooManyRowsReturnedError ](../../api/polars.exceptions.TooManyRowsReturnedError.html)

  * [ Testing ](../../testing.html) __
    * [ polars.testing.assert_frame_equal ](../../api/polars.testing.assert_frame_equal.html)
    * [ polars.testing.assert_frame_not_equal ](../../api/polars.testing.assert_frame_not_equal.html)
    * [ polars.testing.assert_series_equal ](../../api/polars.testing.assert_series_equal.html)
    * [ polars.testing.assert_series_not_equal ](../../api/polars.testing.assert_series_not_equal.html)
    * [ polars.testing.parametric.dataframes ](../../api/polars.testing.parametric.dataframes.html)
    * [ polars.testing.parametric.series ](../../api/polars.testing.parametric.series.html)
    * [ polars.testing.parametric.column ](../../api/polars.testing.parametric.column.html)
    * [ polars.testing.parametric.columns ](../../api/polars.testing.parametric.columns.html)
    * [ polars.testing.parametric.create_list_strategy ](../../api/polars.testing.parametric.create_list_strategy.html)
    * [ polars.testing.parametric.load_profile ](../../api/polars.testing.parametric.load_profile.html)
    * [ polars.testing.parametric.set_profile ](../../api/polars.testing.parametric.set_profile.html)

  * [ Metadata ](../../metadata.html) __
    * [ polars.build_info ](../../api/polars.build_info.html)
    * [ polars.get_index_type ](../../api/polars.get_index_type.html)
    * [ polars.show_versions ](../../api/polars.show_versions.html)
    * [ polars.thread_pool_size ](../../api/polars.thread_pool_size.html)
    * [ polars.threadpool_size ](../../api/polars.threadpool_size.html)

  * [ __ ](../../../index.html)
  * [ Python API reference ](../../index.html)
  * __
  * [ List ](../list.html)
  * polars.Serie... 

#  polars.Series.list.gather  #

Series.list.  gather  (

     _ indices  :  Series  |  [ list  ](https://docs.python.org/3/library/stdtypes.html#list "\(in Python v3.12\)") [  [ int  ](https://docs.python.org/3/library/functions.html#int "\(in Python v3.12\)") ]  |  [ list  ](https://docs.python.org/3/library/stdtypes.html#list "\(in Python v3.12\)") [  [ list  ](https://docs.python.org/3/library/stdtypes.html#list "\(in Python v3.12\)") [  [ int  ](https://docs.python.org/3/library/functions.html#int "\(in Python v3.12\)") ]  ]  _ , 
     _ *  _ , 
     _ null_on_oob  :  [ bool  ](https://docs.python.org/3/library/functions.html#bool "\(in Python v3.12\)") =  False  _ , 
)  →  Series  [ [source]  ](https://github.com/pola-
rs/polars/blob/py-0.20.23/py-polars/polars/series/list.py#L432-L465) #

    

Take sublists by multiple indices.

The indices may be defined in a single column, or by sublists in another
column of dtype ` List  ` .

Parameters  :

    

**indices**

    

Indices to return per sublist

**null_on_oob**

    

Behavior if an index is out of bounds: True -> set as null False -> raise an
error Note that defaulting to raising an error is much cheaper

Examples

    
    
    >>> s = pl.Series("a", [[3, 2, 1], [], [1, 2]])
    >>> s.list.gather([0, 2], null_on_oob=True)
    shape: (3,)
    Series: 'a' [list[i64]]
    [
        [3, 1]
        [null, null]
        [1, null]
    ]
    

[ __ previous  polars.Series.list.first  ](polars.Series.list.first.html
"previous page") [ next  polars.Series.list.get  __
](polars.Series.list.get.html "next page")

__ On this page

  * ` Series.list.gather()  `

© Copyright 2020, Ritchie Vink.  

Created using [ Sphinx ](https://www.sphinx-doc.org/) 7.2.4.  

Built with the [ PyData Sphinx Theme ](https://pydata-sphinx-
theme.readthedocs.io/en/stable/index.html) 0.14.1.