Corran commited on
Commit
c8924bf
·
verified ·
1 Parent(s): 272a0f3

Update fruitchecker.ipynb

Browse files
Files changed (1) hide show
  1. fruitchecker.ipynb +5 -5
fruitchecker.ipynb CHANGED
@@ -11,8 +11,8 @@
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,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 (string, not file)\n",
41
- "csv_output = df.to_csv('output.csv',index=False)\n"
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
+ }