我如何修改IntelliJ的Emacs键盘映射中的控制/选项/命令键映射?(How can I modify the control/option/command key mappings in the IntelliJ's Emacs keymap?)
默认情况下,Mac OS X上的GNU Emacs将控制键用作CTRL ,将命令键用作META 。 这让我发疯,因为我的MacBook Pro在左侧只包含一个控制键,而我习惯于在键盘的两侧都有一个控制键。
通过我的GNU Emacs安装,我可以修改变量
mac-control-modifier
,mac-command-modifier
和mac-option-modifier
以便命令充当CTRL并且选项充当META 。我如何在IntelliJ IDEA中完成同样的事情? 选择“Emacs”作为键盘图很容易,但我没有看到任何方式对CTRL和META进行类似的重新映射。 我知道我可以在操作系统中重新映射这些密钥,但我不想这样做。 我也知道我可以接受每一个动作并单独修改它们,但这似乎是一个糟糕的解决方案。
GNU Emacs on Mac OS X, by default, uses the control key as CTRL, and the command key as META. This drives me crazy, because my MacBook Pro contains only a single control key on the left, while I'm used to having a control key on both sides of the keyboard.
With my GNU Emacs installation, I was able to modify the variables
mac-control-modifier
,mac-command-modifier
, andmac-option-modifier
so that command acts as CTRL and option acts as META.How can I accomplish the same thing in IntelliJ IDEA? It's easy to select "Emacs" as the keymap, but I don't see any way make a similar remapping of CTRL and META. I know I could remap these keys globally in the OS, but I don't want to do that. I also know I could go in to each and every action and individually modify them, but that seems like a poor solution.
原文:https://stackoverflow.com/questions/3537324
最满意答案
好的OP,想出了这一个。 不完全确定这是为什么 ,但这是因为你命名了你的文件。 不知何故命名你的脚本
dateutil.py
和导入dateutil / pandas导致一个问题。我在本地得到了同样的错误,直到我重命名为止。 尝试将你的文件重命名为
myfile.py
,你的问题应该解决。Alright OP, figured this one out. Not exactly sure why this is the case, but it's because of what you named your file. Somehow naming your script
dateutil.py
and importing dateutil/pandas is causing a problem.I got the same error locally until I renamed it. Try renaming your file to something like
myfile.py
and your problem should be solved.
相关问答
更多-
从当前工作目录中删除(或重命名) matplotlib.py文件。 它使用相同的名称遮蔽真正的图书馆。 Remove (or rename) the file matplotlib.py from your current working directory. It shadows the real library with the same name.
-
您需要先转换to_datetime然后使用dt.month : print (pd.to_datetime(df.Date).dt.month) 0 10 1 10 2 9 3 9 Name: Date, dtype: int64 apply另一个更慢的解决方案: print (df.Date.apply(lambda x: x.month)) 0 10 1 10 2 9 3 9 Name: Date, dtype: int64 时间 : #[40 ...
-
是的,您的问题是您需要将axis=1传递给.apply : In [52]: df Out[52]: Type Trans Date Post Date Description Amount 0 Sale 01/25/2018 01/25/2018 DESC1 -13.95 1 Sale 01/25/2018 01/26/2018 AMAZON MKTPLACE PMTS -6.99 2 Sale 01/24/2018 ...
-
好的OP,想出了这一个。 不完全确定这是为什么 ,但这是因为你命名了你的文件。 不知何故命名你的脚本dateutil.py和导入dateutil / pandas导致一个问题。 我在本地得到了同样的错误,直到我重命名为止。 尝试将你的文件重命名为myfile.py ,你的问题应该解决。 Alright OP, figured this one out. Not exactly sure why this is the case, but it's because of what you named your ...
-
_metadata ,不是公共API的一部分。 目前还不是稳定的做法 In [8]: df = pd.DataFrame([[1, 2], [5, 6]], columns=['A', 'B']) In [9]: df['A']._metadata Out[9]: ['name'] In [10]: df['A']._metadata.append({'units': 'm/s'}) In [11]: df['C'] = [3, 8] In [12]: df['A']._metadata Out[1 ...
-
将HTML表格放入pandas Dataframe,而不是数据框对象列表(Get HTML table into pandas Dataframe, not list of dataframe objects)[2022-03-04]
从http://pandas.pydata.org/pandas-docs/version/0.17.1/io.html#io-read-html,“read_html返回一个DataFrame对象列表,即使只包含一个表HTML内容“。 所以df = df[0].dropna(axis=0, thresh=4)应该做你想要的。 From http://pandas.pydata.org/pandas-docs/version/0.17.1/io.html#io-read-html, "read_html r ... -
pleas.DataFrame的子类的属性在pickle之后消失(Attributes to a subclass of pandas.DataFrame disappear after pickle)[2022-06-12]
这与子类化无关。 Pandas对象的属性不会序列化。 您可以阅读此主题以进行讨论和解决方法。 在最近的另一个帖子中,该主题再次浮出水面。 This is unrelated to subclassing. Pandas objects' attributes do not serialize. You can read this thread for a discussion and a workaround. The topic has resurfaced again in this other rec ... -
pandas已删除该功能,现在它作为不同的包提供( 链接 ): DataReader删除了子包pandas.io.data,转而使用可单独安装的pandas-datareader包。 这将允许数据模块独立更新到您的pandas安装。 pandas-datareader v0.1.1的API与pandas v0.16.1中的API相同。 (GH8961) 您应该替换以下导入: from pandas.io import data, wb With: from pandas_datareader import ...
-
这个对我有用: >>> import rpy2 >>> import pandas as pd >>> import pandas.rpy.common as com >>> rpy2.__version__ '2.3.1' >>> pd.__version__ '0.10.0' >>> datframe = pd.DataFrame({'a' : [1, 2, 3], 'b' : [3, 4, 5]}) >>> r_df = com.convert_to_r_dataframe(datframe) >>> ...
-
您可以使用: df = pd.DataFrame({'a':['london','newyork','berlin'], 'b':['uk','usa','germany'], 'c':[7,8,9]}) print (df) df1 = df[['a', 'b']] def doSomething(x): return x.a #function works with DataFrame print (doSome ...