AttributeError: 'DataFrame' object has no attribute 'extract'
时间: 2023-09-22 08:06:03 浏览: 149
bcremoveobjectimageattributecontent:BC Remove Object Image Attribute Content 提供了一个稳定而灵活的解决方案,允许用户根据当前版本、所有版本或新版本动态删除内容对象图像属性内容。 提供对图像属性内容的脚本化操作!
This error message indicates that you are trying to call the 'extract' method on a pandas DataFrame object, but this method does not exist for this object. It is likely that you meant to call the 'str.extract' method on a column of the DataFrame, rather than the DataFrame itself.
For example, if you have a DataFrame called 'df' with a column called 'text', and you want to extract a substring from this column using a regular expression, you can use the following code:
```
df['text'].str.extract(r'(\d+)')
```
This will extract the first group of consecutive digits from each string in the 'text' column and return a new DataFrame with these substrings.
阅读全文