Snippets Collections
for idx in range(num):
    # Print the first 16 most representative topics
    print("Topic #%s:" % idx, lda_model.print_topic(idx, 6))
# selectdataframe from index from list of int
top_sim = [21, 24622, 32199, 32570, 17463]

top_sim_frame = job_vec.loc[top_simi, : ]
# --------------------

You nedd add () because & has higher precedence than ==:

df3 = df[(df['count'] == '2') & (df['price'] == '100')]
print (df3)
  id count price
0  1     2   100

If need check multiple values use isin:

df4 = df[(df['count'].isin(['2','7'])) & (df['price'].isin(['100', '221']))]
print (df4)
  id count price
0  1     2   100
3  4     7   221

But if check numeric, use:

df3 = df[(df['count'] == 2) & (df['price'] == 100)]
print (df3)

df4 = df[(df['count'].isin([2,7])) & (df['price'].isin([100, 221]))]
print (df4)

stop_words = list(stopwords(["zh"]))
cc = OpenCC('s2t')
stop_word = []
for i in stop_words:
    text = cc.convert(i)
    stop_word.append(text)
print(stop_word)

lista   = ['请问','谢谢您','谢谢你','谢谢','谢','您好','_','喔', '意思', '午', '意', "感",'想','问']
cc = OpenCC('s2t')
stop_wordsf = []
for i in lista:
    text = cc.convert(i)
    stop_wordsf.append(text)
print(stop_wordsf)
star

Wed Oct 13 2021 07:27:39 GMT+0000 (UTC)

#chinese #stopwords #convertchitra
star

Thu Oct 07 2021 08:48:22 GMT+0000 (UTC) https://thispointer.com/select-rows-columns-by-name-or-index-in-dataframe-using-loc-iloc-python-pandas/

#chinese #stopwords #convertchitra

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension