selecao = dados['Tipo'].isin(residencial).head() # Cria uma Series com o valor de "Verdadeiro ou falso"
selecao
dados_residencial = dados[selecao]
C:\Users\Leonardo\Anaconda3\lib\site-packages\ipykernel_launcher.py:1: UserWarning: Boolean Series key will be reindexed to match DataFrame index.
"""Entry point for launching an IPython kernel.
---------------------------------------------------------------------------
IndexingError Traceback (most recent call last)
<ipython-input-20-a23451e97289> in <module>
----> 1 dados_residencial = dados[selecao]
~\Anaconda3\lib\site-packages\pandas\core\frame.py in __getitem__(self, key)
2969 # Do we have a (boolean) 1d indexer?
2970 if com.is_bool_indexer(key):
-> 2971 return self._getitem_bool_array(key)
2972
2973 # We are left with two options: a single key, and a collection of keys,
~\Anaconda3\lib\site-packages\pandas\core\frame.py in _getitem_bool_array(self, key)
3021 # check_bool_indexer will throw exception if Series key cannot
3022 # be reindexed to match DataFrame rows
-> 3023 key = check_bool_indexer(self.index, key)
3024 indexer = key.nonzero()[0]
3025 return self.take(indexer, axis=0)
~\Anaconda3\lib\site-packages\pandas\core\indexing.py in check_bool_indexer(index, key)
2409 if mask.any():
2410 raise IndexingError(
-> 2411 "Unalignable boolean Series provided as "
2412 "indexer (index of the boolean Series and of "
2413 "the indexed object do not match)."
IndexingError: Unalignable boolean Series provided as indexer (index of the boolean Series and of the indexed object do not match).