Module Expr Str Import alias Import alias identifier Import alias identifier ImportFrom alias Assign NameStore Call AttributeLoad NameLoad attr NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call NameLoad NameLoad keyword AttributeLoad NameLoad attr For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body Assign NameStore AttributeLoad Call AttributeLoad NameLoad attr NameLoad NameLoad keyword Set NameLoad attr Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad SubscriptLoad NameLoad Index NameLoad Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index CompareGt NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Str Return NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr BoolOpOr NameLoad Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call NameLoad NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list decorator_list
N/A N/A 
Use the ``RelocationModel`` class to choose movers based on
relocation rates.

 N/A logging N/A numpy np N/A pandas pd N/A util N/A logger N/A N/A logging getLogger __name__ find_movers N/A N/A choosers rates rate_column N/A N/A N/A 
    Returns an array of the indexes of the `choosers` that are slated
    to move.

    Parameters
    ----------
    choosers : pandas.DataFrame
        Table of agents from which to find movers.
    rates : pandas.DataFrame
        Table of relocation rates. Index is unused.

        Other columns describe filters on the `choosers`
        table so that different segments can have different relocation
        rates. Columns that ends with '_max' will be used to create
        a "less than" filters, columns that end with '_min' will be
        used to create "greater than or equal to" filters.
        A column with no suffix will be used to make an 'equal to' filter.

        An example `rates` structure:

        age_of_head_max  age_of_head_min
                    nan               65
                     65               40

        In this example the `choosers` table would need to have an
        'age_of_head' column on which to filter.

        nan should be used to flag filters that do not apply
        in a given row.
    rate_column : object
        Name of column in `rates` table that has relocation rates.

    Returns
    -------
    movers : pandas.Index
        Suitable for indexing `choosers` by index.

     N/A N/A N/A logger debug start: find movers for relocation N/A relocation_rates N/A N/A pd Series N/A N/A np zeros N/A len choosers index N/A choosers index N/A N/A _ row N/A N/A rates iterrows N/A N/A indexes N/A N/A N/A util filter_table choosers row ignore N/A rate_column index N/A N/A N/A relocation_rates loc N/A indexes N/A row N/A rate_column N/A movers N/A N/A relocation_rates index N/A N/A relocation_rates N/A N/A N/A np random random N/A len choosers N/A N/A N/A logger debug N/A N/A picked {} movers for relocation format N/A len movers N/A N/A N/A logger debug finish: find movers for relocation N/A movers N/A RelocationModel N/A object N/A N/A 
    Find movers within a population according to a table of
    relocation rates.

    Parameters
    ----------
    rates : pandas.DataFrame
        Table of relocation rates. Index is unused.

        Other columns describe filters on the `choosers`
        table so that different segments can have different relocation
        rates. Columns that ends with '_max' will be used to create
        a "less than" filters, columns that end with '_min' will be
        used to create "greater than or equal to" filters.
        A column with no suffix will be used to make an 'equal to' filter.

        An example `rates` structure:

        age_of_head_max  age_of_head_min
                    nan               65
                     65               40

        In this example the `choosers` table would need to have an
        'age_of_head' column on which to filter.

        nan should be used to flag filters that do not apply
        in a given row.
    rate_column : object, optional
        Name of column in `rates` table that contains relocation rates.
        If not given 'probability_of_relocating' is used.

     __init__ N/A N/A self rates rate_column N/A None N/A N/A N/A self relocation_rates rates N/A N/A self rate_column N/A rate_column probability_of_relocating N/A find_movers N/A N/A self choosers N/A N/A N/A 
        Select movers from among a table of `choosers` according to the
        stored relocation rates.

        Parameters
        ----------
        choosers : pandas.DataFrame
            Table of agents from which to find movers.

        Returns
        -------
        movers : pandas.Index
            Suitable for indexing `choosers` by index.

         N/A N/A find_movers choosers N/A self relocation_rates N/A self rate_column N/A N/A