You've got the wrong syntax for a pymongo call in a couple of areas. This should work assuming "collection" is the name of the collection.
db.collection.ensure_index([("x" , pymongo.ASCENDING), ("unique" , True), ("dropDups" , True)])
Pymongo (and Python) require a list of key direction pairs not a Dict, as Dicts are unordered. Also the syntax for an ascending index is pymongo.ASCENDING. Finally no "$" required for unique and dropDups.