I want to keep the file names without the.csv extension, but using rstrip('.csv') deletes the last letter in the strings ending in s:
data_files = [
"ap_2010.csv",
"class_size.csv",
"demographics.csv",
"graduation.csv",
"hs_directory.csv",
"sat_results.csv"
]
data_names = [name.rstrip('.csv') for name in data_files]
I get this results:
["ap_2010", "class_size", "demographic","graduation","hs_directory", "sat_result"]
The end s of strings demographics and sat_results has been removed, why does this happen??