import bpy, bmesh

context = bpy.context
ob = context.object
me = ob.data
bm = bmesh.from_edit_mesh(me)

# DESELECT ALL OF OBJECT FACES

for f in bm.faces:
    f.select_set(False)

# GET FACES OF OBJECT IN EDIT MODE

faces = set(bm.faces)

for face in faces:

    for v in (face.verts):

        # GET VERTCLES OF FACE MORE THEN Z = 0

        if v.co.z != 0:
            face.select_set(True)

bpy.ops.mesh.select_all(action='INVERT')

bmesh.update_edit_mesh(me)