Did you try something like below.
Filtering:
df[df.name.str[-1].apply(lambda x: x in ['a', 'e', 'i', 'o', 'u'])]
Refer:
Lambda and filter in Python Examples[
^]
Saving to CSV:
df.to_csv('new-location\\output_filtered_sample1.csv', index=False, quoting=1)
Refer:
pandas.DataFrame.to_csv — pandas 1.5.0 documentation[
^]
Overall:
df = pandas.read_csv('location-of-file\\sample1.csv')
filtereddf = df[df.name.str[-1].apply(lambda x: x in ['a', 'e', 'i', 'o', 'u'])]
filtereddf.to_csv('new-location\\output_filtered_sample1.csv', index=False, quoting=1)
try out!