data编程代做、python程序设计代写
Week 8 and 9 Literate programming
(Communicating Results)

1 Default setting of the Quarto Manuscript
1.1 Create the folder
(1) Create an empty folder for Quarto Manuscript and give it a proper name.
(2) Click File-New File-Quarto project-Manuscript project.
(3) Choose the folder we created in step 1.
1.2 Check the main YAML
(1) title:
(2) authors:
(3) bibliography: article citation
1.3 Check the structure of working folder
(1) _quarto.yml: format YAML. This is related to metadata and front matter of the
manuscript. Different formats of output are customized in this ffle.
(2) index.qmd: we write in this main document.
(3) references.bib: your references (which can be downloaded through Google Scholar or
through Zotero).
(4) Rename index.qmd as 0_main_ffle.qmd.
11.4 Generate two additional markdown ffles
Those additional markdown ffles conduct analysis that complement this main ffle.
1_generate_number: remember to put your affffliation here.
2_generate_ffgure: remember to put your affffliation here.
2 Edit YAML section and YAML ffle
2.1 Change the main ffle name in YAML
Please go to _quarto.yml to change the default ffle name to manuscript: article:
0_main_ffle.qmd.
2.2 Python engine
jupyter: python3
2.3 Affffliation
title: Assignment 3
affffliation: University of Auckland
email: xxxx
2.4 Date
date: last-modiffed
2.5 Abstract
abstract: Please put your absract of assignment 3 here. Example: This course will teach
you data science workffow. The course will focus on Python for Finance and reproducible
analytical pipeline.
22.6 keywords
Please put your keywords here
keywords: - Quarto - Manuscript
2.7 Add PDF as one of the output
Go to _quarto.yml
add pdf: default at the next level paramater of format:
comment out jats: default
3 Render the manuscript
3.1 First try
Click the preview button in Vscode.
Additional folders generated: .quarto, _manuscript, _freeze
_freeze: code is not re-evaluated unless their source changes. A corresponding _freeze folder
will be created.
3.2 Click on Word and PDF icon form your folder
Please go to the folder you created at step 1 of Section 1.1
This probably does not work.
Solution 1: Click on Word and PDF icon within Vscode.
Solution 2: manually edit the format parameter within YAML.
3.3 Add number for each section
number-sections: true
34 Python code cells
4.1 Article Notebook: wrong way
If you only run the following code, The article notebook will not appear..
Mylist = [1,2,3,4]
4.2 Article Notebook: correct way
We have to print something or return an object to make Article Notebook show up.
[1, 2, 3, 4]
4.3 Echo code or not
In the code, we can add the following parameter to control whether code will be echoed in the
main text (not Article Notebook):
#| echo: true
More about code cells on the following page: https://quarto.org/docs/reference/cells/cellsjupyter.html
4.4
Output results or not
#| output: false
Mylist = [1,2,3,4]
Mylist
4.5 Other useful code cells parametrs
#| code-fold: true (Collapse code into an HTML tag)
#| code-line-numbers: true (Include line numbers in code block output)
45 Numbers, ffgures, and tables
5.1 Inline code for numbers
The average gap of eruption is 2.5.
5.2 External embeds: a ffgure
Let us import a ffgure created in another QMD ffle.
Figure 1: Timeline of recent earthquakes on La Palma
Embed: please refer to https://quarto.org/docs/authoring/notebook-embed.html for details
of how to use embeds in Quarto.
5.3 External embeds: speciffc folded line of code
Use the following code to import pandas:
import pandas as pd
import numpy as np
5.4 Display tables
An example adapted from Quarto documentation. Table 1 shows information related to different
car models.
Table 1: Example
mpg cylinders displacement horsepower weight
18 8 307 130 3504
15 8 350 165 3693
5Table 1: Example
mpg cylinders displacement horsepower weight
18 8 318 150 3436
16 8 304 150 3433
17 8 302 140 3449
15 8 429 198 4341
14 8 454 220 4354
14 8 440 215 4312
14 8 455 225 4425
15 8 390 190 3850
5.5 Add existing figures from a folder
Figure 2: A logo for BUSFIN 711
5.6 Cross References
We can cross-reference figures, tables, equations, sections, etc.
5.7 External embeds: several line of code
This is mainly for the purpose of demonstration:
6 1_generate_number
A (University of Auckland)
import pandas as pd
import numpy as np
67 Reference
Indirect citation: This is a simple placeholder for the manuscript’s main document (Knuth
1984).
Direct citation: Knuth (1984) is am important paper.
Add more references to references.bib file.
Acknowledgement: some of materials are adapted from Quarto official documentation.
Knuth, Donald E. 1984. “Literate Programming.” Comput. J. 27 (2): 97–111. https://doi.or
g/10.1093/comjnl/27.2.97.
7

热门主题

课程名

mktg2509 csci 2600 38170 lng302 csse3010 phas3226 77938 arch1162 engn4536/engn6536 acx5903 comp151101 phl245 cse12 comp9312 stat3016/6016 phas0038 comp2140 6qqmb312 xjco3011 rest0005 ematm0051 5qqmn219 lubs5062m eee8155 cege0100 eap033 artd1109 mat246 etc3430 ecmm462 mis102 inft6800 ddes9903 comp6521 comp9517 comp3331/9331 comp4337 comp6008 comp9414 bu.231.790.81 man00150m csb352h math1041 eengm4100 isys1002 08 6057cem mktg3504 mthm036 mtrx1701 mth3241 eeee3086 cmp-7038b cmp-7000a ints4010 econ2151 infs5710 fins5516 fin3309 fins5510 gsoe9340 math2007 math2036 soee5010 mark3088 infs3605 elec9714 comp2271 ma214 comp2211 infs3604 600426 sit254 acct3091 bbt405 msin0116 com107/com113 mark5826 sit120 comp9021 eco2101 eeen40700 cs253 ece3114 ecmm447 chns3000 math377 itd102 comp9444 comp(2041|9044) econ0060 econ7230 mgt001371 ecs-323 cs6250 mgdi60012 mdia2012 comm221001 comm5000 ma1008 engl642 econ241 com333 math367 mis201 nbs-7041x meek16104 econ2003 comm1190 mbas902 comp-1027 dpst1091 comp7315 eppd1033 m06 ee3025 msci231 bb113/bbs1063 fc709 comp3425 comp9417 econ42915 cb9101 math1102e chme0017 fc307 mkt60104 5522usst litr1-uc6201.200 ee1102 cosc2803 math39512 omp9727 int2067/int5051 bsb151 mgt253 fc021 babs2202 mis2002s phya21 18-213 cege0012 mdia1002 math38032 mech5125 07 cisc102 mgx3110 cs240 11175 fin3020s eco3420 ictten622 comp9727 cpt111 de114102d mgm320h5s bafi1019 math21112 efim20036 mn-3503 fins5568 110.807 bcpm000028 info6030 bma0092 bcpm0054 math20212 ce335 cs365 cenv6141 ftec5580 math2010 ec3450 comm1170 ecmt1010 csci-ua.0480-003 econ12-200 ib3960 ectb60h3f cs247—assignment tk3163 ics3u ib3j80 comp20008 comp9334 eppd1063 acct2343 cct109 isys1055/3412 math350-real math2014 eec180 stat141b econ2101 msinm014/msing014/msing014b fit2004 comp643 bu1002 cm2030
联系我们
EMail: 99515681@qq.com
QQ: 99515681
留学生作业帮-留学生的知心伴侣!
工作时间:08:00-21:00
python代写
微信客服:codinghelp
站长地图