Skip to content

Commit c46c09e

Browse files
committed
replaced 'template' with 'format' to match course recording
1 parent e384097 commit c46c09e

1 file changed

Lines changed: 18 additions & 18 deletions

File tree

finished_files/001_equal_weight_S&P_500.ipynb

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -342,15 +342,15 @@
342342
"background_color = '#0a0a23'\n",
343343
"font_color = '#ffffff'\n",
344344
"\n",
345-
"string_template = writer.book.add_format(\n",
345+
"string_format = writer.book.add_format(\n",
346346
" {\n",
347347
" 'font_color': font_color,\n",
348348
" 'bg_color': background_color,\n",
349349
" 'border': 1\n",
350350
" }\n",
351351
" )\n",
352352
"\n",
353-
"dollar_template = writer.book.add_format(\n",
353+
"dollar_format = writer.book.add_format(\n",
354354
" {\n",
355355
" 'num_format':'$0.00',\n",
356356
" 'font_color': font_color,\n",
@@ -359,7 +359,7 @@
359359
" }\n",
360360
" )\n",
361361
"\n",
362-
"integer_template = writer.book.add_format(\n",
362+
"integer_format = writer.book.add_format(\n",
363363
" {\n",
364364
" 'num_format':'0',\n",
365365
" 'font_color': font_color,\n",
@@ -382,7 +382,7 @@
382382
"```python\n",
383383
"writer.sheets['Recommended Trades'].set_column('B:B', #This tells the method to apply the format to column B\n",
384384
" 18, #This tells the method to apply a column width of 18 pixels\n",
385-
" string_template #This applies the format 'string_template' to the column\n",
385+
" string_format #This applies the format 'string_format' to the column\n",
386386
" )\n",
387387
"```"
388388
]
@@ -393,14 +393,14 @@
393393
"metadata": {},
394394
"outputs": [],
395395
"source": [
396-
"# writer.sheets['Recommended Trades'].write('A1', 'Ticker', string_template)\n",
397-
"# writer.sheets['Recommended Trades'].write('B1', 'Price', string_template)\n",
398-
"# writer.sheets['Recommended Trades'].write('C1', 'Market Capitalization', string_template)\n",
399-
"# writer.sheets['Recommended Trades'].write('D1', 'Number Of Shares to Buy', string_template)\n",
400-
"# writer.sheets['Recommended Trades'].set_column('A:A', 20, string_template)\n",
401-
"# writer.sheets['Recommended Trades'].set_column('B:B', 20, dollar_template)\n",
402-
"# writer.sheets['Recommended Trades'].set_column('C:C', 20, dollar_template)\n",
403-
"# writer.sheets['Recommended Trades'].set_column('D:D', 20, integer_template)\n"
396+
"# writer.sheets['Recommended Trades'].write('A1', 'Ticker', string_format)\n",
397+
"# writer.sheets['Recommended Trades'].write('B1', 'Price', string_format)\n",
398+
"# writer.sheets['Recommended Trades'].write('C1', 'Market Capitalization', string_format)\n",
399+
"# writer.sheets['Recommended Trades'].write('D1', 'Number Of Shares to Buy', string_format)\n",
400+
"# writer.sheets['Recommended Trades'].set_column('A:A', 20, string_format)\n",
401+
"# writer.sheets['Recommended Trades'].set_column('B:B', 20, dollar_format)\n",
402+
"# writer.sheets['Recommended Trades'].set_column('C:C', 20, dollar_format)\n",
403+
"# writer.sheets['Recommended Trades'].set_column('D:D', 20, integer_format)\n"
404404
]
405405
},
406406
{
@@ -419,15 +419,15 @@
419419
"outputs": [],
420420
"source": [
421421
"column_formats = { \n",
422-
" 'A': ['Ticker', string_template],\n",
423-
" 'B': ['Price', dollar_template],\n",
424-
" 'C': ['Market Capitalization', dollar_template],\n",
425-
" 'D': ['Number of Shares to Buy', integer_template]\n",
422+
" 'A': ['Ticker', string_format],\n",
423+
" 'B': ['Price', dollar_format],\n",
424+
" 'C': ['Market Capitalization', dollar_format],\n",
425+
" 'D': ['Number of Shares to Buy', integer_format]\n",
426426
" }\n",
427427
"\n",
428428
"for column in column_formats.keys():\n",
429429
" writer.sheets['Recommended Trades'].set_column(f'{column}:{column}', 20, column_formats[column][1])\n",
430-
" writer.sheets['Recommended Trades'].write(f'{column}1', column_formats[column][0], string_template)"
430+
" writer.sheets['Recommended Trades'].write(f'{column}1', column_formats[column][0], string_format)"
431431
]
432432
},
433433
{
@@ -465,7 +465,7 @@
465465
"name": "python",
466466
"nbconvert_exporter": "python",
467467
"pygments_lexer": "ipython3",
468-
"version": "3.8.2"
468+
"version": "3.8.5"
469469
}
470470
},
471471
"nbformat": 4,

0 commit comments

Comments
 (0)