I have a pandas Dataframe with one column a list of files
import pandas as pd df = pd.read_csv(\'fname.csv\') df.head() filename A B C fn1.txt 2
You can use str.rstrip to remove the endings:
df['filename'] = df['filename'].str.rstrip('.txt')
should work