Module ImportFrom alias ImportFrom alias alias ImportFrom alias alias ImportFrom alias ImportFrom alias alias ImportFrom alias FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore BinOpAdd AttributeLoad NameLoad attr Call NameLoad keyword UnaryOpUSub BinOpMod AttributeLoad AttributeLoad NameLoad attr attr Num Return Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad Str body If CompareIs NameLoad Str body Assign NameStore Call NameLoad NameLoad For NameStore AttributeLoad NameLoad attr body If BoolOpAnd CompareEq AttributeLoad NameLoad attr NameLoad CompareEq AttributeLoad NameLoad attr Str body AugAssignAdd SubscriptStore NameLoad Index AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return NameLoad If CompareIs NameLoad NameLoad body Assign NameStore Lambda arguments args NameParam defaults AttributeLoad NameLoad attr Assign NameStore GeneratorExp NameLoad comprehension NameStore AttributeLoad NameLoad attr CompareEq AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad Call NameLoad NameLoad keyword NameLoad keyword NameLoad Return Call NameLoad DictComp NameLoad Call NameLoad Call NameLoad GeneratorExp Call NameLoad NameLoad comprehension NameStore NameLoad comprehension TupleStore NameStore NameStore NameLoad If CompareIn NameLoad ListLoad Str Str body Assign NameStore ListComp AttributeLoad NameLoad attr comprehension NameStore AttributeLoad NameLoad attr BoolOpAnd CompareEq AttributeLoad NameLoad attr NameLoad CompareEq AttributeLoad NameLoad attr NameLoad orelse Raise Call NameLoad Call AttributeLoad Str attr NameLoad Return Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad Num NameLoad body Assign NameStore Call NameLoad NameLoad keyword NameLoad Assign NameStore Call NameLoad NameLoad FunctionDef arguments args NameParam defaults body Assign NameStore ListLoad For NameStore NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad If CompareIs NameLoad NameLoad body Assign NameStore ListComp IfExp CompareNotEq NameLoad NameLoad NameLoad Num comprehension NameStore NameLoad orelse Assign NameStore Call NameLoad NameLoad keyword NameLoad Assign NameStore ListComp Call AttributeLoad NameLoad attr NameLoad NameLoad comprehension NameStore NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list Assign NameStore Call NameLoad Str Assign NameStore Call NameLoad Str Assign NameStore ListComp ListComp IfExp CompareIsNot SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index NameLoad NameLoad SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index NameLoad SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index NameLoad comprehension NameStore Call NameLoad Call NameLoad NameLoad comprehension NameStore Call NameLoad Call NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return BinOpAdd ListLoad AttributeLoad NameLoad attr Call NameLoad ListComp NameLoad comprehension NameStore Call AttributeLoad AttributeLoad NameLoad attr attr CompareNotEq NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Return Call NameLoad NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad keyword NameLoad For NameStore Call NameLoad Call NameLoad NameLoad body For NameStore Call NameLoad Call NameLoad NameLoad body If BoolOpAnd CompareIsNot SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index NameLoad NameLoad CompareGt SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index NameLoad Num body Assign SubscriptStore SubscriptLoad NameLoad Index NameLoad Index NameLoad Num Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call NameLoad NameLoad keyword NameLoad Assign NameStore ListComp ListComp Num comprehension NameStore Call NameLoad Call NameLoad NameLoad comprehension NameStore Call NameLoad Call NameLoad NameLoad For NameStore Call NameLoad Call NameLoad NameLoad body For NameStore Call NameLoad Call NameLoad NameLoad body If BoolOpAnd CompareNotEq NameLoad NameLoad SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index NameLoad SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index NameLoad body Assign SubscriptStore SubscriptLoad NameLoad Index NameLoad Index NameLoad BinOpAdd SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index NameLoad SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index NameLoad orelse If BoolOpOr CompareIs SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index NameLoad NameLoad CompareIs SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index NameLoad NameLoad body Assign SubscriptStore SubscriptLoad NameLoad Index NameLoad Index NameLoad NameLoad orelse Assign SubscriptStore SubscriptLoad NameLoad Index NameLoad Index NameLoad Num Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad keyword NameLoad For TupleStore NameStore NameStore Call NameLoad Call NameLoad Call NameLoad NameLoad Num body If BoolOpAnd CompareGt SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index NameLoad Num CompareGt SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index NameLoad Num body Assign TupleStore SubscriptStore SubscriptLoad NameLoad Index NameLoad Index NameLoad SubscriptStore SubscriptLoad NameLoad Index NameLoad Index NameLoad TupleLoad Num Num Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad Assign NameStore Num For TupleStore NameStore NameStore Call NameLoad Call NameLoad Call NameLoad NameLoad Num body Assign TupleStore NameStore NameStore NameStore TupleLoad SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index NameLoad SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index Num SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index Num If BoolOpAnd CompareIsNot NameLoad NameLoad CompareIsNot NameLoad NameLoad CompareIsNot NameLoad NameLoad body If BoolOpAnd CompareGt NameLoad Num CompareGt NameLoad Num CompareGt NameLoad Num body AugAssignAdd NameStore Num Assign NameStore Call NameLoad SubscriptLoad NameLoad Index Num Return IfExp CompareGt NameLoad Num BinOpDiv BinOpMult Num NameLoad BinOpMult NameLoad BinOpSub NameLoad Num Num decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call NameLoad NameLoad keyword NameLoad Assign NameStore Num Assign NameStore Call NameLoad GeneratorExp NameLoad comprehension NameStore NameLoad comprehension NameStore NameLoad For TupleStore NameStore NameStore Call NameLoad Call NameLoad Call NameLoad NameLoad Num body Assign TupleStore NameStore NameStore NameStore TupleLoad SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index NameLoad SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index Num SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index Num If BoolOpAnd CompareIsNot NameLoad NameLoad CompareIsNot NameLoad NameLoad CompareIsNot NameLoad NameLoad body If BoolOpAnd NameLoad NameLoad NameLoad body AugAssignAdd NameStore BinOpDiv BinOpPow BinOpMult BinOpMult NameLoad NameLoad NameLoad BinOpDiv Num Num NameLoad Assign NameStore Call NameLoad GeneratorExp Num comprehension NameStore SubscriptLoad NameLoad Index Num CompareGt NameLoad Num Return IfExp CompareGt NameLoad Num BinOpDiv BinOpMult Num NameLoad BinOpMult NameLoad BinOpSub NameLoad Num Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad keyword NameLoad Assign NameStore DictComp NameLoad NameLoad comprehension TupleStore NameStore NameStore Call AttributeLoad NameLoad attr BoolOpAnd CompareNotEq NameLoad Str CompareNotEq SubscriptLoad NameLoad Slice Num Str CompareNotEq SubscriptLoad NameLoad Slice Num Str For TupleStore NameStore NameStore Call NameLoad Call NameLoad NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad If BoolOpOr CompareIs NameLoad NameLoad CompareEq NameLoad AttributeLoad NameLoad attr CompareEq SubscriptLoad SubscriptLoad NameLoad Index Num Index NameLoad Num body Continue Assign NameStore Call NameLoad NameLoad keyword NameLoad For NameStore NameLoad body If BoolOpAnd CompareIsNot SubscriptLoad NameLoad Index NameLoad NameLoad CompareIsNot SubscriptLoad NameLoad Index NameLoad NameLoad body AugAssignAdd SubscriptStore NameLoad Index NameLoad Num AugAssignAdd SubscriptStore NameLoad Index NameLoad BinOpPow BinOpSub SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad Num Assign NameStore Dict For NameStore NameLoad body Assign SubscriptStore NameLoad Index NameLoad BinOpDiv SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad Assign NameStore ListComp NameLoad comprehension NameStore Call AttributeLoad AttributeLoad NameLoad attr attr CompareNotEq NameLoad AttributeLoad NameLoad attr Assign NameStore Dict For TupleStore NameStore NameStore Call NameLoad Call NameLoad NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad If BoolOpOr CompareIs NameLoad NameLoad CompareEq NameLoad AttributeLoad NameLoad attr CompareEq SubscriptLoad SubscriptLoad NameLoad Index Num Index NameLoad Num body Continue If AttributeLoad NameLoad attr body Assign SubscriptStore NameLoad Index AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Dict For NameStore AttributeLoad NameLoad attr body Assign NameStore Call NameLoad GeneratorExp Num comprehension NameStore NameLoad BoolOpAnd CompareIn NameLoad NameLoad CompareEq SubscriptLoad AttributeLoad NameLoad attr Index NameLoad SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index NameLoad Assign NameStore Call NameLoad GeneratorExp Num comprehension NameStore NameLoad CompareIn NameLoad NameLoad Assign SubscriptStore NameLoad Index NameLoad IfExp CompareNotEq NameLoad Num BinOpDiv NameLoad NameLoad NameLoad Return NameLoad decorator_list
N/A __future__ division collections Counter defaultdict itertools groupby combinations functools partial datetime datetime timedelta bandicoot.utils all _round_half_hour N/A N/A record N/A N/A N/A 
    Round a time DOWN to half nearest half-hour.
     N/A k N/A N/A record datetime N/A timedelta minutes N/A N/A N/A N/A record datetime minute 30 N/A N/A datetime N/A k year N/A k month N/A k day N/A k hour N/A k minute 0 N/A _count_interaction N/A N/A user interaction direction N/A None out N/A N/A N/A interaction call_duration N/A N/A d N/A defaultdict int N/A r N/A user records N/A N/A N/A N/A N/A r direction direction N/A N/A r interaction call N/A N/A N/A d N/A N/A r correspondent_id N/A r call_duration N/A d N/A N/A interaction None N/A N/A keyfn N/A N/A N/A x N/A N/A x correspondent_id N/A records N/A r N/A r N/A user records N/A N/A r direction direction N/A chunks N/A groupby N/A sorted records key keyfn key keyfn N/A N/A Counter N/A c_id N/A len N/A set N/A N/A _round_half_hour i N/A i items N/A N/A c_id items chunks N/A N/A interaction N/A call text N/A N/A filtered N/A N/A x correspondent_id N/A x N/A user records N/A N/A N/A x interaction interaction N/A N/A x direction direction N/A N/A N/A ValueError N/A N/A {} is not a correct value of interaction, only 'call', 'text', and 'call_duration' are accepted format interaction N/A N/A Counter filtered N/A _interaction_matrix N/A N/A user interaction default missing N/A None 0 None N/A N/A generating_fn N/A partial _count_interaction interaction interaction N/A neighbors N/A matrix_index user make_direction N/A N/A direction N/A N/A N/A rows N/A N/A u neighbors N/A N/A correspondent N/A N/A N/A user network get u user N/A N/A correspondent None N/A N/A row N/A N/A N/A v u missing 0 N/A v neighbors N/A N/A cur_out N/A generating_fn correspondent direction direction N/A row N/A N/A N/A cur_out get v default N/A v neighbors N/A N/A N/A rows append row N/A rows N/A N/A m1 N/A make_direction out N/A m2 N/A make_direction in N/A m N/A N/A N/A N/A N/A N/A m1 N/A i N/A j None N/A N/A m1 N/A i N/A j N/A N/A m2 N/A j N/A i N/A j N/A range N/A len neighbors N/A i N/A range N/A len neighbors N/A m N/A matrix_index N/A N/A user N/A N/A N/A 
    Returns the keys associated with each axis of the matrices.

    The first key is always the name of the current user, followed by the
    sorted names of all the correspondants.
     N/A N/A N/A N/A user name N/A sorted N/A k N/A k N/A N/A N/A user network keys N/A k N/A user name N/A matrix_directed_weighted N/A N/A user interaction N/A None N/A N/A 
    Returns a directed, weighted matrix for call, text and call duration.

    If interaction is None, the weight measures both calls and texts: the weight is the number
    of 30 minutes periods with at least one call or one text.

    Example
    -------

    >>> m = bc.network.matrix_directed_weighted(user, interaction='call')

    ``m[i][j]`` is the number of calls from ``i`` to ``j``.
     N/A N/A _interaction_matrix user interaction interaction N/A matrix_directed_unweighted N/A N/A user N/A N/A N/A 
    Returns a directed, unweighted matrix where an edge exists if there is at
    least one call or text.
     N/A matrix N/A _interaction_matrix user interaction None N/A a N/A range N/A len matrix N/A N/A b N/A range N/A len matrix N/A N/A N/A N/A N/A N/A matrix N/A a N/A b None N/A N/A N/A matrix N/A a N/A b 0 N/A N/A N/A N/A matrix N/A a N/A b 1 N/A matrix N/A matrix_undirected_weighted N/A N/A user interaction N/A None N/A N/A 
    Returns an undirected, weighted matrix for call, text and call duration
    where an edge exists if the relationship is reciprocated.
     N/A matrix N/A _interaction_matrix user interaction interaction N/A result N/A N/A 0 N/A _ N/A range N/A len matrix N/A _ N/A range N/A len matrix N/A a N/A range N/A len matrix N/A N/A b N/A range N/A len matrix N/A N/A N/A N/A a b N/A N/A matrix N/A a N/A b N/A N/A matrix N/A b N/A a N/A N/A N/A N/A result N/A a N/A b N/A N/A N/A matrix N/A a N/A b N/A N/A matrix N/A b N/A a N/A N/A N/A N/A N/A N/A matrix N/A a N/A b None N/A N/A N/A matrix N/A b N/A a None N/A N/A N/A N/A result N/A a N/A b None N/A N/A N/A N/A result N/A a N/A b 0 N/A result N/A matrix_undirected_unweighted N/A N/A user N/A N/A N/A 
    Returns an undirected, unweighted matrix where an edge exists if the
    relationship is reciprocated.
     N/A matrix N/A matrix_undirected_weighted user interaction None N/A N/A a b N/A combinations N/A range N/A len matrix 2 N/A N/A N/A N/A N/A N/A matrix N/A a N/A b 0 N/A N/A N/A matrix N/A b N/A a 0 N/A N/A N/A N/A N/A matrix N/A a N/A b N/A N/A matrix N/A b N/A a N/A 1 1 N/A matrix N/A clustering_coefficient_unweighted N/A N/A user N/A N/A N/A 
    The clustering coefficient of the user in the unweighted, undirected ego
    network.

    It is defined by counting the number of closed triplets including the current user:

    .. math::
        C = \frac{2 * \text{closed triplets}}{ \text{degree} \, (\text{degree - 1})}

    where ``degree`` is the degree of the current user in the network.
     N/A matrix N/A matrix_undirected_unweighted user N/A closed_triplets 0 N/A N/A a b N/A combinations N/A xrange N/A len matrix 2 N/A N/A N/A a_b a_c b_c N/A N/A N/A matrix N/A a N/A b N/A N/A matrix N/A a N/A 0 N/A N/A matrix N/A b N/A 0 N/A N/A N/A a_b None N/A a_c None N/A b_c None N/A N/A N/A N/A a_b 0 N/A a_c 0 N/A b_c 0 N/A N/A closed_triplets 1.0 N/A d_ego N/A sum N/A matrix N/A 0 N/A N/A N/A d_ego 1 N/A N/A 2 closed_triplets N/A d_ego N/A d_ego 1 0 N/A clustering_coefficient_weighted N/A N/A user interaction N/A None N/A N/A 
    The clustering coefficient of the user's weighted, undirected network.

    It is defined the same way as :meth`~bandicoot.network.clustering_coefficient_unweighted`,
    except that closed triplets are weighted by the number of interactions. For each triplet
    (A, B, C), we compute the geometric mean of the number of interactions, using the
    undirected weighted matrix:

    .. math::
        weight_{abc} = (m_{ab} \; m_{bc} \; m_{ac})^{1/3}

    The weight is normalized, between 0 and 1, by the maximum value in the matrix.
     N/A matrix N/A matrix_undirected_weighted user interaction interaction N/A triplet_weight 0 N/A max_weight N/A max N/A weight N/A g matrix N/A weight g N/A N/A a b N/A combinations N/A range N/A len matrix 2 N/A N/A N/A a_b a_c b_c N/A N/A N/A matrix N/A a N/A b N/A N/A matrix N/A a N/A 0 N/A N/A matrix N/A b N/A 0 N/A N/A N/A a_b None N/A a_c None N/A b_c None N/A N/A N/A a_b a_c b_c N/A N/A triplet_weight N/A N/A N/A N/A a_b a_c b_c N/A 1 3 max_weight N/A d_ego N/A sum N/A 1 N/A i N/A matrix N/A 0 N/A i 0 N/A N/A N/A d_ego 1 N/A N/A 2 triplet_weight N/A d_ego N/A d_ego 1 0 N/A assortativity_indicators N/A N/A user N/A N/A N/A 
    Computes the assortativity of indicators.

    This indicator measures the similarity of the current user with his
    correspondants, for all bandicoot indicators. For each one, it calculates
    the variance of the current user's value with the values for all his
    correspondants:

    .. math::

        \text{assortativity}(J) = \frac{1}{n} \sum_i^n (J_{\text{user}} - J_{\text{i}})^2

    for the indicator :math:`J`, and all the :math:`n` correspondents.
     N/A matrix N/A matrix_undirected_unweighted user N/A count_indicator N/A defaultdict int N/A total_indicator N/A defaultdict int N/A ego_indics N/A all user flatten True N/A ego_indics N/A a value N/A N/A a value N/A N/A ego_indics items N/A N/A a name N/A N/A a N/A 11 reporting__ N/A N/A a N/A 10 attributes N/A N/A i u_name N/A enumerate N/A matrix_index user N/A N/A correspondent N/A N/A N/A user network get u_name None N/A N/A N/A correspondent None N/A u_name N/A user name N/A N/A N/A matrix N/A 0 N/A i 0 N/A N/A N/A neighbor_indics N/A all correspondent flatten True N/A a ego_indics N/A N/A N/A N/A N/A ego_indics N/A a None N/A N/A neighbor_indics N/A a None N/A N/A N/A total_indicator N/A a 1 N/A N/A count_indicator N/A a N/A N/A N/A ego_indics N/A a N/A neighbor_indics N/A a 2 N/A assortativity N/A N/A i count_indicator N/A N/A N/A assortativity N/A i N/A N/A count_indicator N/A i N/A total_indicator N/A i N/A assortativity N/A assortativity_attributes N/A N/A user N/A N/A N/A 
    Computes the assortativity of the nominal attributes.

    This indicator measures the homophily of the current user with his
    correspondants, for each attributes. It returns a value between 0
    (no assortativity) and 1 (all the contacts share the same value):
    the percentage of contacts sharing the same value.
     N/A matrix N/A matrix_undirected_unweighted user N/A neighbors N/A k N/A k N/A N/A N/A user network keys N/A k N/A user name N/A neighbors_attrbs N/A N/A N/A i u_name N/A enumerate N/A matrix_index user N/A N/A correspondent N/A N/A N/A user network get u_name None N/A N/A N/A correspondent None N/A u_name N/A user name N/A N/A N/A matrix N/A 0 N/A i 0 N/A N/A N/A N/A correspondent has_attributes N/A N/A N/A neighbors_attrbs N/A N/A correspondent name N/A correspondent attributes N/A assortativity N/A N/A a N/A user attributes N/A N/A total N/A sum N/A 1 N/A n neighbors N/A N/A n neighbors_attrbs N/A N/A N/A user attributes N/A a N/A N/A neighbors_attrbs N/A n N/A a N/A den N/A sum N/A 1 N/A n neighbors N/A n neighbors_attrbs N/A N/A assortativity N/A a N/A N/A den 0 N/A total den None N/A assortativity N/A