---------------------------------------------------------------------------
KeyboardInterrupt Traceback (most recent call last)
<ipython-input-11-dd710b53e90c> in <module>()
----> 1 functionWiseSims(functions=['manager'], verbose=False)
<ipython-input-7-97bd42da5770> in functionWiseSims(functions, verbose)
27 chosen_titles = titlesWithFunc(func, title_df)
28
---> 29 sims = simsAmong(chosen_titles, doc_topic_distr, df, verbose)
30
31 if not sims.empty:
D:\larc_projects\job_analytics\src\ja_helpers.pyc in simsAmong(titles, doc_topic_distr, df, verbose)
631 print(msg.format(n_title))
632
--> 633 if n_title > 1:
634 t0 = time()
635
D:\larc_projects\job_analytics\src\ja_helpers.pyc in sims2SubseqTitle(i, titles, doc_topic_distr, cached_posts, verbose)
616 res['topic_sim'] = res['t1'].apply(titleSim, t2=focus_title,
617 doc_topic_distr=doc_topic_distr,
--> 618 cached_posts=cached_posts, verbose=verbose)
619
620 print('\t Calculated sims of {} to all subseq titles'.format(focus_title))
D:\conda\lib\site-packages\pandas\core\series.pyc in apply(self, func, convert_dtype, args, **kwds)
2292 else:
2293 values = self.asobject
-> 2294 mapped = lib.map_infer(values, f, convert=convert_dtype)
2295
2296 if len(mapped) and isinstance(mapped[0], Series):
pandas\src\inference.pyx in pandas.lib.map_infer (pandas\lib.c:66124)()
D:\conda\lib\site-packages\pandas\core\series.pyc in <lambda>(x)
2280
2281 if kwds or args and not isinstance(func, np.ufunc):
-> 2282 f = lambda x: func(x, *args, **kwds)
2283 else:
2284 f = func
D:\larc_projects\job_analytics\src\ja_helpers.pyc in titleSim(t1, t2, doc_topic_distr, df, cached_posts, verbose)
603 n1, n2 = posts1.shape[0], posts2.shape[0]
604 print('\t{} ({} posts) vs. {} ({} posts)'.format(t1, n1, t2, n2))
--> 605 return postSimScore(posts1, posts2, doc_topic_distr)
606
607 def sims2SubseqTitle(i, titles, doc_topic_distr, cached_posts=None, verbose=False):
D:\larc_projects\job_analytics\src\ja_helpers.pyc in postSimScore(posts1, posts2, doc_topic_distr)
587 n1, n2 = posts1.shape[0], posts2.shape[0]
588 if (n1 > 0) and (n2 > 0):
--> 589 res = crossSimScores(posts1, posts2, doc_topic_distr, verbose=False)
590 topic_sim = round(res['topic_sim'].mean(), 3)
591 return topic_sim # return res
D:\larc_projects\job_analytics\src\ja_helpers.pyc in crossSimScores(posts1, posts2, doc_topic_distr, verbose)
576 n1 = posts1.shape[0]; n2 = posts2.shape[0]
577
--> 578 frames = [sims2Set(posts1.iloc[i], posts2) for i in xrange(n1)]
579 res = pd.concat(frames);
580 return res
D:\larc_projects\job_analytics\src\ja_helpers.pyc in sims2Set(p, posts)
567 def sims2Set(p, posts):
568 n_post = posts.shape[0]
--> 569 frames = [sims(p, posts.iloc[i]) for i in xrange(n_post)]
570 # global count; count += 1
571 # if (count % 10 == 0) and verbose:
D:\conda\lib\site-packages\pandas\core\indexing.pyc in __getitem__(self, key)
1310 return self._getitem_tuple(key)
1311 else:
-> 1312 return self._getitem_axis(key, axis=0)
1313
1314 def _getitem_axis(self, key, axis=0):
D:\conda\lib\site-packages\pandas\core\indexing.pyc in _getitem_axis(self, key, axis)
1628 self._is_valid_integer(key, axis)
1629
-> 1630 return self._get_loc(key, axis=axis)
1631
1632 def _convert_to_indexer(self, obj, axis=0, is_setter=False):
D:\conda\lib\site-packages\pandas\core\indexing.pyc in _get_loc(self, key, axis)
103
104 def _get_loc(self, key, axis=0):
--> 105 return self.obj._ixs(key, axis=axis)
106
107 def _slice(self, obj, axis=0, kind=None):
D:\conda\lib\site-packages\pandas\core\frame.pyc in _ixs(self, i, axis)
1974 copy = True
1975 else:
-> 1976 new_values = self._data.fast_xs(i)
1977 if is_scalar(new_values):
1978 return new_values
D:\conda\lib\site-packages\pandas\core\internals.pyc in fast_xs(self, loc)
3493
3494 # non-unique (GH4726)
-> 3495 if not items.is_unique:
3496 result = self._interleave()
3497 if self.ndim == 2:
KeyboardInterrupt: