我有一个年份列,其中包含我抓取的 IMDB 电影列表中年份之前的罗马数字。我尝试使用此代码,但没有删除它们。列名称称为“发布年份”。任何建议或见解将不胜感激。
import pandas as pd
# create a dataframe from the csv file and read the file into our dataFrame
df = pd.read_excel('Master IMDB File Practice Clean.xlsx')
# to remove roman numerals from column "Release Year"
df['Release Year'].str.replace(r'\W',"")
print(df)
这是整个列中突出显示的罗马数字的 excel 文件
