import pandas as pd
import numpy as np
d1 = pd.DataFrame(pd.read_csv("skribbleSkribbl-words.csv"))
keyword_len = int(input('Number of total letters of the keyword: '))
hint1 = input('type hint no. 1 :')
hint1_pos = input('position of hint 1 in keyword :')
hint2 = input('type hint no. 2 :')
hint2_pos = input('position of hint 2 in keyword :')
plausiblewords = d1.loc[d1['count'] == keyword_len]
print(plausiblewords)
this is the code i wrote just for some fun while playing skribble.io online with friends and got curious if i could narrow down the words of the plausible keyword the current word allows me to a dataframe of keywords with a specific no. of letters but i need help to further filter it down by the hints we get in a usual game which is 2 most of the time, i need to filter the dataframe so that i get all the keywords that have that specific letter at that specific place. I don’t want it to be a dataframe in specific list works too.
i have tried further using loc but i can’t get around doing it and i am a beginner so i don’t know what to do, if someone could tell me what to do with a brief explanation it would help a lot.
Binitpyro is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1