Spaces:
Sleeping
Sleeping
Update fruitchecker.ipynb
Browse files- fruitchecker.ipynb +5 -5
fruitchecker.ipynb
CHANGED
@@ -11,8 +11,8 @@
|
|
11 |
"source": [
|
12 |
"import json\n",
|
13 |
"\n",
|
14 |
-
"with open(
|
15 |
-
"
|
16 |
]
|
17 |
},
|
18 |
{
|
@@ -37,8 +37,8 @@
|
|
37 |
"prices = [(fruit, fruit_prices.get(fruit, 'N/A')) for fruit in fruits]\n",
|
38 |
"df = pd.DataFrame(prices, columns=['Fruit', 'Price'])\n",
|
39 |
"\n",
|
40 |
-
"# Convert to CSV (
|
41 |
-
"csv_output = df.to_csv(
|
42 |
]
|
43 |
}
|
44 |
],
|
@@ -63,4 +63,4 @@
|
|
63 |
},
|
64 |
"nbformat": 4,
|
65 |
"nbformat_minor": 5
|
66 |
-
}
|
|
|
11 |
"source": [
|
12 |
"import json\n",
|
13 |
"\n",
|
14 |
+
"with open('/tmp/input.txt', 'r') as f:\n",
|
15 |
+
" fruits = f.read().splitlines()"
|
16 |
]
|
17 |
},
|
18 |
{
|
|
|
37 |
"prices = [(fruit, fruit_prices.get(fruit, 'N/A')) for fruit in fruits]\n",
|
38 |
"df = pd.DataFrame(prices, columns=['Fruit', 'Price'])\n",
|
39 |
"\n",
|
40 |
+
"# Convert to CSV (store as string)\n",
|
41 |
+
"csv_output = df.to_csv(index=False)"
|
42 |
]
|
43 |
}
|
44 |
],
|
|
|
63 |
},
|
64 |
"nbformat": 4,
|
65 |
"nbformat_minor": 5
|
66 |
+
}
|