Skip to content

Commit cd962f3

Browse files
committed
switch to f-strings
Some cells were still using str.format. A bunch of the internal python files also use them, but I care less about that.
1 parent 2258eac commit cd962f3

File tree

2 files changed

+72
-52
lines changed

2 files changed

+72
-52
lines changed

02-Discrete-Bayes.ipynb

+8-9
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@
581581
{
582582
"data": {
583583
"application/vnd.jupyter.widget-view+json": {
584-
"model_id": "2709d4897c90432eabebbcf3aa60113c",
584+
"model_id": "c65bc79da49448efb42e0bfd882986e4",
585585
"version_major": 2,
586586
"version_minor": 0
587587
},
@@ -758,7 +758,7 @@
758758
{
759759
"data": {
760760
"application/vnd.jupyter.widget-view+json": {
761-
"model_id": "29c7da8c293a43ddb6e34bd840e9971e",
761+
"model_id": "67b1c6758fff4724b590d76d758d0de5",
762762
"version_major": 2,
763763
"version_minor": 0
764764
},
@@ -1250,7 +1250,7 @@
12501250
{
12511251
"data": {
12521252
"application/vnd.jupyter.widget-view+json": {
1253-
"model_id": "f47a87a1ec27474ea864c92a52ce4ac9",
1253+
"model_id": "30b640471e4c4f91a079e8f32994f7f3",
12541254
"version_major": 2,
12551255
"version_minor": 0
12561256
},
@@ -1303,7 +1303,7 @@
13031303
{
13041304
"data": {
13051305
"application/vnd.jupyter.widget-view+json": {
1306-
"model_id": "15dde650d59e4ffe88e2163d1220860f",
1306+
"model_id": "32ba45c576874b9d965aa34b6cbb2002",
13071307
"version_major": 2,
13081308
"version_minor": 0
13091309
},
@@ -1527,9 +1527,8 @@
15271527
" print()\n",
15281528
" print('final position is', robot.pos)\n",
15291529
" index = np.argmax(posterior)\n",
1530-
" print('''Estimated position is {} with '''\n",
1531-
" '''confidence {:.4f}%:'''.format(\n",
1532-
" index, posterior[index]*100))"
1530+
" conf = posterior[index]*100\n",
1531+
" print(f'Estimated position is {index} with confidence {conf:.4f}')"
15331532
]
15341533
},
15351534
{
@@ -1558,7 +1557,7 @@
15581557
" estimated position is 6 with confidence 100.0000%:\n",
15591558
"\n",
15601559
"final position is 6\n",
1561-
"Estimated position is 6 with confidence 100.0000%:\n"
1560+
"Estimated position is 6 with confidence 100.0000\n"
15621561
]
15631562
},
15641563
{
@@ -1607,7 +1606,7 @@
16071606
" estimated position is 8 with confidence 49.3174%:\n",
16081607
"\n",
16091608
"final position is 7\n",
1610-
"Estimated position is 8 with confidence 49.3174%:\n"
1609+
"Estimated position is 8 with confidence 49.3174\n"
16111610
]
16121611
},
16131612
{

04-One-Dimensional-Kalman-Filters.ipynb

+64-43
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)