带有 pandas 的ipython中的自动完成功能似乎已被打破 [英] AutoComplete in ipython with pandas Seems to be broken
问题描述
我有一个名为 frame
我想调用frame[SomeCoulmnname].value_counts()
方法
问题在于,即使我在之后键入 v ,ipython也不会自动完成. 实际上,它甚至没有返回任何建议.
The issue is that ipython doesnt autocomplete even after i type v after the . In fact it doesnt even return any suggestions.
但是,如果我只是键入系列.并按一下选项卡,它会向我返回我正在寻找的可能方法.
But if i simply type Series. and press the tab it return me the possible methods that i am looking for.
我的问题是为什么iPython的行为会如此?尽管与PyCharm的工作相同!
My question is why is iPython behaving like this?The same work with PyCharm though!
在此方面的任何帮助将不胜感激.谢谢
Any help on this will be greatly appreciated.Thanks
推荐答案
这不是熊猫特有的.
如果没有实际运行frame[SomeCoulmnname]
,IPython无法知道/猜测通过运行frame[SomeCoulmnname]
返回的对象的类型.由于它也不能假设运行它是安全/快速/等方式,因此它不会运行.
IPython cannot know/guess the type of the object returned by running frame[SomeCoulmnname]
without actually running it. Since it also cannot assume running it is safe/fast/etc, it doesn't run it.
由于它不知道对象的类型,因此无法建议完成的对象.
Since it doesn't know the type of the object, it can't suggest completions for it.
Series.<TAB>
之所以有效,是因为不需要猜测. IPython知道Series
是一种类型,因此它可以解析其成员.
Series.<TAB>
works because no guessing is required. IPython knows that Series
is a type, hence it can resolve its members.
一种解决方案是将临时值分配给变量:
A solution would be to assign the temporary value to a variable:
s = frame[SomeCoulmnname]
s.v<TAB>
这篇关于带有 pandas 的ipython中的自动完成功能似乎已被打破的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!