我想检查一个系列中的单词是否以系列的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) 我得到了以下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)