This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Citation examples used in the sample text (random authors and titles with random dates) | |
| (Sabbagh, 2009) | |
| (Sabbagh, n.d.) | |
| (Sabbagh, 2010a) | |
| (Sabbagh, 2010b) | |
| (Qianyi Gu & Sumner, 2006) | |
| (Despotovic-Zrakic et al., 2012) | |
| (Anonymous, 2010) | |
| (Anonymous, n.d.) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Citation examples: | |
| ("Learning Analytics - Definitions, Processes and Potential", p. 2) | |
| ("Wanted: A road map for understanding Integrated Learning Systems") | |
| """ | |
| import docx2txt as docx | |
| import re | |
| # Open the document | |
| text = docx.process("my_lorem_sample.docx") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Sales people: | |
| Lyndsey Britt | |
| Humphrey Barr | |
| Mathew Rudd | |
| Gianluca Fenton | |
| Alfie-Lee Schultz | |
| Amarah Mccarty | |
| Douglas Povey | |
| Dulcie Squires | |
| Haydon Fisher |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from matplotlib import pyplot as plt | |
| import numpy as np | |
| days = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] | |
| # Need to save the data for the Y axis as NumPy arrays because the\ | |
| # `fill_between()` method needs to receive arrays instead of lists | |
| company_sales = np.array([2, 6, 9, 12, 8, 15, 20, 32, 27, 30]) | |
| competition_sales = np.array([1, 2, 4, 5, 13, 12, 18, 22, 34, 38]) | |
| plt.plot(days, company_sales, color="blue", label="Company A") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from matplotlib import pyplot as plt | |
| ages = [83, 50, 88, 31, 37, 52, 81, 58, 23, 60, 51, 62, 36, 95, 64, 59, 91, 70, 35, | |
| 94, 61, 65, 96, 21, 95, 78, 99, 33, 29, 35, 29, 98, 54, 48, 97, 41, 29, 82, | |
| 67, 55, 37, 99, 20, 69, 70, 98, 88, 41, 30, 58, 96, 33, 25, 52, 40, 69, 40, | |
| 32, 50, 51, 64, 57, 75, 87, 37, 37, 82, 68, 65, 96, 45, 27, 52, 86, 51, 45, | |
| 52, 67, 72, 98, 84, 76, 43, 26, 44, 41, 58, 19, 84, 21, 87, 46, 84, 76, 61, | |
| 74, 32, 58, 66, 29] | |
| bins = [10, 20, 30, 40, 50, 60, 70, 80, 90, 100] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from matplotlib import pyplot as plt | |
| pairs_owned = [16, 9, 9, 6] | |
| options = ["One", "Two", "Three", "Four+"] | |
| plt.barh(options, pairs_owned) | |
| plt.title("Years of experience working with Python (n=40)") | |
| plt.xlabel("Number of respondents") | |
| plt.tight_layout() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from matplotlib import pyplot as plt | |
| pairs_owned = [16, 9, 9, 6] | |
| options = ["One", "Two", "Three", "Four+"] | |
| plt.bar(options, pairs_owned) | |
| plt.title("Years of experience working with Python (n=40)") | |
| plt.ylabel("Number of respondents") | |
| plt.tight_layout() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from matplotlib import pyplot as plt | |
| slices = [1, 9, 3, 3, 4] | |
| labels = ["Management", "Sales", "Quality Assurance", "Accounting", "Human Resources"] | |
| colors = ["#ff9999", "#66b3ff", "#99ff99", "#ffcc99", "#cccccc"] | |
| plt.pie(slices, labels=labels, colors=colors, autopct="%1.2f%%") | |
| plt.title("Size of departments at Company A") | |
| plt.tight_layout() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from matplotlib import pyplot as plt | |
| x_coords = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20] | |
| fav_nums = [9, 37, 45, 32, 46, 56, 28, 9, 16, 68, 64, 100, 25, 1, 59, 50, 31, 96, 13, 76] | |
| plt.scatter(x_coords, fav_nums, marker="x", color="red") | |
| plt.ylabel("Favorite number") | |
| plt.xticks([]) | |
| plt.title("Favorite number of twenty individuals") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from matplotlib import pyplot as plt | |
| nums = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] | |
| doubles = [2, 4, 6, 8, 10, 12, 14, 16, 18, 20] | |
| squares = [1, 4, 9, 16, 25, 36, 49, 64, 81, 100] | |
| plt.plot(nums, doubles, label="Doubles", color="red") | |
| plt.plot(nums, squares, label="Squares", color="blue") | |
| plt.xlabel("Number") |