Commit ·
b3a8efd
1
Parent(s): 6a4eb61
Rename very_small_token_data.json to very_small_token_data.jsonl
Browse files
very_small_token_data.json → very_small_token_data.jsonl
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
|
| 2 |
{
|
| 3 |
"Intruction": "This is a question asked by a user",
|
| 4 |
"Context": "The stock span problem is a financial problem where we have a series of n daily\nprice quotes for a stock and we need to calculate span of stock's price for all n days.\n\nThe span Si of the stock's price on a given day i is defined as the maximum\nnumber of consecutive days just before the given day, for which the price of the stock\non the current day is less than or equal to its price on the given day.",
|
|
@@ -248,5 +248,4 @@
|
|
| 248 |
"Intruction": "This is a question asked by a user",
|
| 249 |
"Context": "Generate code for newton_forward_interpolation",
|
| 250 |
"response": "from __future__ import annotations\nimport math\n\n\ndef ucal(u: float, p: int) ->float:\n temp = u\n for i in range(1, p):\n temp = temp * (u - i)\n return temp\n\n\ndef main() ->None:\n n = int(input('enter the numbers of values: '))\n y: list[list[float]] = []\n for _ in range(n):\n y.append([])\n for i in range(n):\n for j in range(n):\n y[i].append(j)\n y[i][j] = 0\n print('enter the values of parameters in a list: ')\n x = list(map(int, input().split()))\n print('enter the values of corresponding parameters: ')\n for i in range(n):\n y[i][0] = float(input())\n value = int(input('enter the value to interpolate: '))\n u = (value - x[0]) / (x[1] - x[0])\n for i in range(1, n):\n for j in range(n - i):\n y[j][i] = y[j + 1][i - 1] - y[j][i - 1]\n summ = y[0][0]\n for i in range(1, n):\n summ += ucal(u, i) * y[0][i] / math.factorial(i)\n print(f'the value at {value} is {summ}')\n\n\nif __name__ == '__main__':\n main()"
|
| 251 |
-
}
|
| 252 |
-
]
|
|
|
|
| 1 |
+
|
| 2 |
{
|
| 3 |
"Intruction": "This is a question asked by a user",
|
| 4 |
"Context": "The stock span problem is a financial problem where we have a series of n daily\nprice quotes for a stock and we need to calculate span of stock's price for all n days.\n\nThe span Si of the stock's price on a given day i is defined as the maximum\nnumber of consecutive days just before the given day, for which the price of the stock\non the current day is less than or equal to its price on the given day.",
|
|
|
|
| 248 |
"Intruction": "This is a question asked by a user",
|
| 249 |
"Context": "Generate code for newton_forward_interpolation",
|
| 250 |
"response": "from __future__ import annotations\nimport math\n\n\ndef ucal(u: float, p: int) ->float:\n temp = u\n for i in range(1, p):\n temp = temp * (u - i)\n return temp\n\n\ndef main() ->None:\n n = int(input('enter the numbers of values: '))\n y: list[list[float]] = []\n for _ in range(n):\n y.append([])\n for i in range(n):\n for j in range(n):\n y[i].append(j)\n y[i][j] = 0\n print('enter the values of parameters in a list: ')\n x = list(map(int, input().split()))\n print('enter the values of corresponding parameters: ')\n for i in range(n):\n y[i][0] = float(input())\n value = int(input('enter the value to interpolate: '))\n u = (value - x[0]) / (x[1] - x[0])\n for i in range(1, n):\n for j in range(n - i):\n y[j][i] = y[j + 1][i - 1] - y[j][i - 1]\n summ = y[0][0]\n for i in range(1, n):\n summ += ucal(u, i) * y[0][i] / math.factorial(i)\n print(f'the value at {value} is {summ}')\n\n\nif __name__ == '__main__':\n main()"
|
| 251 |
+
}
|
|
|