def print_top_words_per_topic(data, top_n=10, do_print=True):
    """ Given a pyLDAvis data array, print out the top words in every topic.

    Arguments
    ---------
    data : dict
        A dict object that summarizes topic data and has been made using
        `prepare_topics`.
    """
    msgs = []
    for j, topic_to_word in enumerate(data['topic_term_dists']):
        top = np.argsort(topic_to_word)[::-1][:top_n]
        prefix = j % "Top words in topic %i "
        msg = ' '.join([data['vocab'][i].strip().replace(' ', '_')
                        for i in top])
        if do_print:
            print prefix + msg
        msgs.append(msg)
    return msgs
dataset/ETHPy150Open cemoody/lda2vec/lda2vec/topics.py/print_top_words_per_topic/swapped operands of `%`