小编seb*_*835的帖子

熊猫:检查A系列中的单词是否以B系列中的一个单词结尾的最快方法

我想检查一个系列中的单词是否以系列的strings一个单词结尾ending_strings.

strings = Series(['om', 'foo_nom', 'nom', 'bar_foo', 'foo','blah'])
ending_strings = Series(['nom', 'foo'])
expected_results = Series([False, True, True, True, True, False])
Run Code Online (Sandbox Code Playgroud)

我已经提出了以下代码,但有没有更快或更多的熊猫风格的方式来做到这一点?

from pandas import Series

def ew(v):
    return strings.str.endswith(v) 
result = ending_strings.apply(ew).apply(sum).astype(bool)
result.equals(expected_results)
Run Code Online (Sandbox Code Playgroud)

python performance pandas

7
推荐指数
1
解决办法
2114
查看次数

Apache Oozie无法加载ShareLib

我得到了以下oozie.log:

org.apache.oozie.service.ServiceException: E0104: Could not fully initialize service [org.apache.oozie.service.ShareLibService], Not able to cache sharelib. An Admin needs to install the sharelib with oozie-setup.sh and issue the 'oozie admin' CLI command to update the sharelib
Run Code Online (Sandbox Code Playgroud)

我运行以下命令:

oozie-setup.sh sharelib create -fs hdfs://localhost:54310
oozied.sh start

hdfs dfs -ls /user/hduser/share/lib
15/02/24 18:05:03 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Found 3 items
drwxr-xr-x   - hduser supergroup          0 2015-02-24 17:19 /user/hduser/share/lib/lib_20150224171855
drwxr-xr-x   - hduser supergroup          0 2015-02-24 …
Run Code Online (Sandbox Code Playgroud)

hadoop oozie

4
推荐指数
2
解决办法
3570
查看次数

标签 统计

hadoop ×1

oozie ×1

pandas ×1

performance ×1

python ×1