pythonProject\venv\lib\site-packages\PIL\Image.py", line 2895, in open AttributeError: 'strsite-packages\PIL\Image.py", line 2897, in open AttributeError: 'str' object has no attribute 'read
我有一个包含URL的dataframe列。我希望通过对每一行使用regex模式从这个URL中提取一个特定的字符串。下面是URL字符串的一个示例:由于列是一个系列,需要迭代,因此我尝试了以下代码:for i in df['landing_screen_name']:
regex = i.str.extract(r'.{0
我的pandas DataFrame看起来如下所示。我正在尝试从我的'$'列中删除','和income,然后在我的原始数据中应用。所以我创建了下面的函数。然而,它让我错误地说了"str" object has no attribute "str".注:我是刚接触python的人,所以请提供解释。],
'income