gpt4 book ai didi

python - Jupyter 中 Pandas 自动补全的问题

转载 作者:行者123 更新时间:2023-12-02 09:28:20 26 4
gpt4 key购买 nike

我遇到问题 similar to this user :在 df.col. 上调用自动完成功能时,即使在评估仅包含 df.col 的单元格后,我也得不到自动完成功能。例如,我希望看到 df.col.str.matc 自动完成为 df.col.str.match。我能做什么来解决这个问题?

以以下数据框为例:

import pandas as pd
data = [['Alex in FL','ten'],['Bob in FLORIDA','five'],['Will in GA','three']]
df = pd.DataFrame(data,columns=['Name','Age'])

#Dataframe:
Name Age
0 Alex in FL ten
1 Bob in FLORIDA five
2 Will in GA three

#Command that should autocomplete (but does not):
df.Name.str.matc [+TAB]

我不想尝试hinterland因为我只想在按 Tab 键时自动完成。

提前非常感谢!

最佳答案

阅读后this ,似乎其他人和特定版本的 ipython 都面临这个问题。该链接上也给出了解决方案。

是这样的:

从终端运行以下命令:

ipython profile create

它将在~/.ipython/profile_default/ipython_config.py创建默认配置文件

现在编辑此ipython_config.py并添加以下行,它将解决问题。

c = get_config()
c.Completer.use_jedi = False

引用:

  1. https://github.com/jupyter/notebook/issues/2435
  2. https://ipython.readthedocs.io/en/stable/config/intro.html

关于python - Jupyter 中 Pandas 自动补全的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58282169/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com