(typingctx, data, index=None, name=None)
return sig, codegen
Create a Series with provided data, index and name values.
    Used as a single constructor for Series and assigning its data, so that
    optimization passes can look for init_series() to see if underlying
    data has changed, and get the array variables from init_series() args if
    not changed.
Create a Series with provided data, index and name values.
    Used as a single constructor for Series and assigning its data, so that
    optimization passes can look for init_series() to see if underlying
    data has changed, and get the array variables from init_series() args if
    not changed.
Create a Series with provided data index and name values . Used as a single constructor for Series and assigning its data so that optimization passes can look for init_series () to see if underlying data has changed and get the array variables from init_series () args if not changed .
def init_series(typingctx, data, index=None, name=None):
    """Create a Series with provided data, index and name values.
    Used as a single constructor for Series and assigning its data, so that
    optimization passes can look for init_series() to see if underlying
    data has changed, and get the array variables from init_series() args if
    not changed.
    """

    index = types.none if index is None else index
    name = types.none if name is None else name
    is_named = False if name is types.none else True

    def codegen(context, builder, signature, args):
        data_val, index_val, name_val = args
        # create series struct and store values
        series = cgutils.create_struct_proxy(
            signature.return_type)(context, builder)
        series.data = data_val
        series.index = index_val
        if is_named:
            if isinstance(name, types.StringLiteral):
                series.name = numba.cpython.unicode.make_string_from_constant(
                    context, builder, string_type, name.literal_value)
            else:
                series.name = name_val

        # increase refcount of stored values
        if context.enable_nrt:
            context.nrt.incref(builder, signature.args[0], data_val)
            context.nrt.incref(builder, signature.args[1], index_val)
            if is_named:
                context.nrt.incref(builder, signature.args[2], name_val)

        return series._getvalue()

    dtype = data.dtype
    # XXX pd.DataFrame() calls init_series for even Series since it's untyped
    data = if_series_to_array_type(data)
    ret_typ = SeriesType(dtype, data, index, is_named)
    sig = signature(ret_typ, data, index, name)
    return sig, codegen
def init_series ( typingctx , data , index = None , name = None ) : index = types . none if index is None else index name = types . none if name is None else name is_named = False if name is types . none else True def codegen ( context , builder , signature , args ) : data_val , index_val , name_val = args # create series struct and store values series = cgutils . create_struct_proxy ( signature . return_type ) ( context , builder ) series . data = data_val series . index = index_val if is_named : if isinstance ( name , types . StringLiteral ) : series . name = numba . cpython . unicode . make_string_from_constant ( context , builder , string_type , name . literal_value ) else : series . name = name_val # increase refcount of stored values if context . enable_nrt : context . nrt . incref ( builder , signature . args [ 0 ] , data_val ) context . nrt . incref ( builder , signature . args [ 1 ] , index_val ) if is_named : context . nrt . incref ( builder , signature . args [ 2 ] , name_val ) return series . _getvalue ( ) dtype = data . dtype # XXX pd.DataFrame() calls init_series for even Series since it's untyped data = if_series_to_array_type ( data ) ret_typ = SeriesType ( dtype , data , index , is_named ) sig = signature ( ret_typ , data , index , name ) return sig , codegen