I want to print the ones that match the last indexes of the mails I read from the Excel file, @gmail.com
. I tried a code like this.
import pandas as pd
excelRead = pd.read_excel('mailing.xlsx')
excelRead.dropna(inplace= True)
excelTest = (excelRead['mails'][:-11] == "@gmail.com")
print(excelTest)
The output I get is True
or False
. I tried a code like this because it says in the sources I researched that I need to import it into a DataFrame
.
import pandas as pd
excelRead = pd.read_excel('mailing.xlsx')
excelRead.dropna(inplace= True)
excelTest = excelRead[(excelRead['mails'][:-11] == "@gmail.com")]
print(excelTest)
But this is the output
I got
pandas.core.indexing.IndexingError: Unalignable boolean Series provided as indexer (index of the boolean Series and of the indexed object do not match).
Where am I making mistakes in the executed codes?