<p>假设我有一个名为<code>df.Text</code>的列,其中包含文本(多于一个句子),我想使用polyglot <code>Detector</code>来检测语言并将值存储在新列<code>df['Text-Lang']</code>中,我如何确保还捕获其他细节,如<code>code</code>和{<cd5>}</p>
<pre><code>testEng ="This is English"
lang = Detector(testEng)
print(lang.language)
</code></pre>
<p>退货</p>
<blockquote>
<p>name: English code: en confidence: 94.0 read bytes: 1920</p>
</blockquote>
<p>但是</p>
^{pr2}$
<p>以结束</p>
<blockquote>
<p>AttributeError: 'float' object has no attribute 'encode' and Detector
is not able to detect the language reliably.</p>
</blockquote>
<p>我是不是错误地应用了检测器功能,或者存储了错误的输出还是其他什么?在</p>