From 63fbf6ef5413f7dfec48641974f7d337a21ce81a Mon Sep 17 00:00:00 2001 From: Deborah Servili Date: Wed, 13 Jul 2016 16:36:54 +0200 Subject: [PATCH] Update tools.py Correct function isTagIn(dataframe, tag) --- examples/situational-awareness/tools.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/examples/situational-awareness/tools.py b/examples/situational-awareness/tools.py index f259f9c..8676dd8 100644 --- a/examples/situational-awareness/tools.py +++ b/examples/situational-awareness/tools.py @@ -127,20 +127,9 @@ def selectInRange(Events, begin=None, end=None): temp = Events.columns.tolist() inRange.columns = temp return inRange -''' -def isTagIn(dataframe, tag): - print 'tag =' + tag - result = [] - for tagname in dataframe['name']: - print tagname - if tag in tagname: - print 'True' - result.append(tagname) - return result -''' def isTagIn(dataframe, tag): - temp = Tags[Tags['name'].str.contains(test)].index.tolist() + temp = dataframe[dataframe['name'].str.contains(tag)].index.tolist() index = [] for i in range(len(temp)): if temp[i][0] not in index: