OneCompiler

groceries

90
<!DOCTYPE html> <html> <body bgcolor="red"> <h1> Welcome </h1> <p id="demo"></p> <script> window.alert("Exams Are Near, Have You Started Preparing For...???"); var person = prompt("Please Enter Your Name:", "Mahesh Patil"); if (person !== null) { document.getElementById("demo").innerHTML = "Hello " + person + "!" + "<br> Exams Are Near, Have You Started Preparing For...???"; } window.confirm("Make Confirmation...!!!"); </script> </body> </html>

=======================================

Importpandasaspd
Frommlxtend.preprocessi
ngimportTransactionEncoder
Frommlxtend.frequent_patternsi
#Loadthedataset
Df=pd.read_csv(‘
mportapriori
,associati
on_rules
market_basket.csv’
)
#Dropanyrowswithnullvalues
Df.dropna(i
nplace=True)
#Convertcategoricalval
uestonumericformat
Te=TransactionEncoder()
Te_ary=te.fi
t(df.
values).
transform(df.
Df=pd.DataFrame(te_ary,col
values)
umns=te.columns_)
#Generatefrequentitemsets
Frequent_i
temsets=apriori
(df,min_support=0.
#Generateassociati
onrules
Rules=association_rul
es(frequent_i
01,use_colnames=True)
temsets,metri
c=”li
ft”,min_threshol
#Displayinformati
onaboutthedataset
d=1)
temsetsand
Print(“Dataseti
nformation:
”)
Print(df.
info())
#Displaythefrequenti
Print(“\nFrequenti
Print(fr
temsets
temsets:”)
equent_itemsets)
#Displaytheassociati
onrules
Print(“\nAssoci
ationrul
es:”)
Print(rul
es