Try something like: for d in data: if d["bid"] is not None and d["ask"] is not None: c.writerow([str(d["currency"]),str(d["symbol"]),str(d["bid"]),str(d["ask"]),str(d["currency_volume"])])
I've used 'is not None' in case 0 or 0.0 are acceptable bid or offer values. If you want to exclude rows with these values as well as None, you can just use: for d in data: if d["bid"] and d["ask"]: # Do stuff There are other ways to do this kind of thing, by the way. Check out list comprehensions sometime. -- http://mail.python.org/mailman/listinfo/python-list