Unfortunately, you can't really tell just from looking at the nut. If the pistachio smells like paint or tastes bitter, you know that the fats have gone rancid.