Spaces:
Sleeping
Sleeping
Commit
·
e988e3b
1
Parent(s):
52d0022
Update app.py
Browse files
app.py
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
import pandas as pd
|
2 |
import streamlit as st
|
3 |
import json
|
|
|
|
|
4 |
f = open('data.json')
|
5 |
dataset = json.load(f)
|
6 |
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
recipes = pd.DataFrame(data={'name': ['paper plane', 'old fashioned'], 'ingredients': [['aperol', 'bourbon'], ['bourbon', 'simple syrup']]})
|
11 |
-
ingredients = pd.DataFrame(data={'name': ['paper plane', 'paper plane', 'old fashioned', 'old fashioned'], 'ingredients': ['aperol', 'bourbon', 'bourbon', 'simple syrup']})
|
12 |
|
13 |
# ingredient filter
|
14 |
options = st.multiselect(
|
|
|
1 |
import pandas as pd
|
2 |
import streamlit as st
|
3 |
import json
|
4 |
+
|
5 |
+
# load data
|
6 |
f = open('data.json')
|
7 |
dataset = json.load(f)
|
8 |
|
9 |
+
# prepare data
|
10 |
+
recipes = pd.DataFrame(recipes)
|
11 |
+
ingredients = pd.DataFrame(recipes).explode('ingredients')
|
|
|
|
|
12 |
|
13 |
# ingredient filter
|
14 |
options = st.multiselect(
|