Is it possible to deselect vertices in Python?
if you want to run it in object mode: 

import bpy
vert = bpy.context.object.data.vertices
face = bpy.context.object.data.polygons #not faces!
edge = bpy.context.object.data.edges
#vertices can be selected 
#to deselect vertices you need to deselect faces(polygons) and edges at first
for i in face:                   
    i.select=False               
for i in edge:
    i.select=False
for i in vert:
    i.select=False
    if i.co.x &gt; 0:
        i.select = True