Complete the method so that it formats the words into a single comma separated value. The last word should be separated by the word 'and' instead of a comma. The method takes in an array of strings and returns a single formatted string. Empty string values should be ignored. Empty arrays or null/nil values being passed into the method should result in an empty string being returned. 
```Python
format_words(['ninja', 'samurai', 'ronin']) # should return "ninja, samurai and ronin"
format_words(['ninja', '', 'ronin']) # should return "ninja and ronin"
format_words([]) # should return ""
```
```Haskell
formatWords ["ninja", "samurai", "ronin"] -- should return "ninja, samurai and ronin"
formatWords ["ninja", "", "ronin"] -- should return "ninja and ronin"
formatWords [] -- should return ""
```
def format_words(words):
    words = [w for w in words if w] if words else ''
    if not words:
        return ''
    return f'{", ".join(words[:-1])} and {words[-1]}' if len(words) !=1 else words[-1]
def format_words(words):
    words = [w for w in words if w] if words else ''
    if not words:
        return ''
    return f'{", ".join(words[:-1])} and {words[-1]}' if len(words) !=1 else words[-1]