def MakeArray(ea, nitems):
    flags = idaapi.getFlags(ea)

    if idaapi.isCode(flags) or idaapi.isTail(flags) or idaapi.isAlign(flags):
        return False

    if idaapi.isUnknown(flags):
        flags = idaapi.FF_BYTE

    if idaapi.isStruct(flags):
        ti = idaapi.opinfo_t()
        assert idaapi.get_opinfo(ea, 0, flags, ti), "get_opinfo() failed"
        itemsize = idaapi.get_data_elsize(ea, flags, ti)
        tid = ti.tid
    else:
        itemsize = idaapi.get_item_size(ea)
        tid = BADADDR

    return idaapi.do_data_ex(ea, flags, itemsize*nitems, tid)
Create an array.
dataset/ETHPy150Open EiNSTeiN-/idapython/python/idc.py/MakeArray