/opt/conda/lib/python3.7/site-packages/ipykernel_launcher.py:8:FutureWarning:DataFrame 与 Series 比较的自动重新索引已弃用,并将在未来版本中引发 ValueError。left, right = left.align(right, axis=1, copy=False)之前做例如left == right
我尝试手动使用 z 分数从数据框中删除异常值
numerical_cols=df.select_dtypes(['int64','float64'])
for col in numerical_cols:
feature_value_less_than_3sigma=df[col].mean()-3*(df[col].std())
feature_value_greater_than_3sigma=df[col].mean()+3*(df[col].std())
df = df[~((df[col] < (feature_value_less_than_3sigma)) |(df[col] > (feature_value_greater_than_3sigma)))]
else:
print('\nAfter: ',df.shape)
Run Code Online (Sandbox Code Playgroud)
我不知道这个错误说明了什么,我想知道它,任何人都可以用一些简单的例子解释一下
为什么我收到此错误任何人都可以告诉我或使用简单的示例解释如何使用它
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/tmp/ipykernel_33/3577035061.py in <module>
6 # Matcher class object
7 matcher = Matcher(nlp.vocab)
----> 8 matcher.add("matching_1", None, pattern)
9
10 matches = matcher(doc)
/opt/conda/lib/python3.7/site-packages/spacy/matcher/matcher.pyx in spacy.matcher.matcher.Matcher.add()
TypeError: add() takes exactly 2 positional arguments (3 given)
Run Code Online (Sandbox Code Playgroud)
在下面的链接中
https://spacy.io/api/matcher
