GoogleメールのAPIからテキストを引っ張ってきた際にリストの中に謎の空白リストが追加されていて順番も不規則だったので処理したときのメモ
リストの中のリストを削除
リストの中のリストに要素が入っていれば別の処理
word_list = ['a', 'b', [], 'c']
result_list = []
for word in word_list:
#リスト要素でない時リストに追加する
if not type(word) is list:
result_list.append(word)
print(result_list) #['a', 'b', 'c']
removeはエラーになる
word_list = ['a', 'b', [], 'c']
word_list.remove('')
#ValueError: list.remove(x): x not in list