diff --git a/Python/Module3_IntroducingNumpy/AdvancedIndexing.md b/Python/Module3_IntroducingNumpy/AdvancedIndexing.md index ee7a0530..cc91851d 100644 --- a/Python/Module3_IntroducingNumpy/AdvancedIndexing.md +++ b/Python/Module3_IntroducingNumpy/AdvancedIndexing.md @@ -128,12 +128,13 @@ The instruction for accessing the contents of `y` in this way is straight-forwar This returns a *copy* of the data, as do all occurrences of advanced indexing. - + ```python # advanced indexing returns a copy >>> np.shares_memory(y, y[index]) False ``` + The indexing array can have an arbitrary shape; *the resulting array will match that shape*. diff --git a/Python/Module3_IntroducingNumpy/Broadcasting.md b/Python/Module3_IntroducingNumpy/Broadcasting.md index 6911821d..41a8f5a6 100644 --- a/Python/Module3_IntroducingNumpy/Broadcasting.md +++ b/Python/Module3_IntroducingNumpy/Broadcasting.md @@ -70,7 +70,6 @@ In effect, NumPy treated `y` as if its contents had been broadcasted along a new It is important to note that NumPy doesn't really create this broadcasted version of `y` behind the scenes; it is able to do the necessary computations without having to redundantly copy its contents into a shape-(3,4) array. Doing so would be a waste of memory and computation. That being said, this replication process conveys exactly the mathematics of broadcast operations between arrays; thus the preceding diagram reflects how you should always envision broadcasting. - Broadcasting is not reserved for operations between 1-D and 2-D arrays, and furthermore both arrays in an operation may undergo broadcasting. That being said, not all pairs of arrays are broadcast-compatible. @@ -109,7 +108,7 @@ array([[[ 0, 0], >>> np.array([1, 2]) * np.array([0, 1, 2]) ValueError: operands could not be broadcast together with shapes (2,) (3,) ``` - +
diff --git a/Python/Module3_IntroducingNumpy/VectorizedOperations.md b/Python/Module3_IntroducingNumpy/VectorizedOperations.md index c9f9c6cb..48defb53 100644 --- a/Python/Module3_IntroducingNumpy/VectorizedOperations.md +++ b/Python/Module3_IntroducingNumpy/VectorizedOperations.md @@ -322,6 +322,7 @@ You *can* apply binary NumPy functions to arrays of unlike shapes. For instance,
+ ```python # example of a binary function operating on two 2D arrays >>> x = np.array([[10, 2], @@ -338,7 +339,7 @@ array([[11, 2], >>> x[:, 0] + y[1, :] array([6, 2]) ``` - +
@@ -378,7 +379,7 @@ array([ 1., 4., 9.]) ``` This process generalizes to an array of any dimensionality and shape. - + ```python # examples of a binary function operating on a scalar & an array @@ -401,6 +402,7 @@ array([[ 0, -2, -4, -6], [ -8, -10, -12, -14]]) ``` +
diff --git a/Python/Module4_OOP/Introduction_to_OOP.md b/Python/Module4_OOP/Introduction_to_OOP.md index bc34fafa..a3e21e44 100644 --- a/Python/Module4_OOP/Introduction_to_OOP.md +++ b/Python/Module4_OOP/Introduction_to_OOP.md @@ -106,6 +106,7 @@ class Rectangle: An instance of this `Rectangle` class is an individual rectangle whose *attributes* include its width, height, and center-location. Additionally, we can use the rectangle's *methods* (its attributes that are functions) to compute its area and the locations of its corners. + ```python # create a rectangle of width 4, height 10, centered at (0, 0) # here __init__ is executed and the width/height/center attributes are set @@ -124,7 +125,7 @@ Rectangle(width=4, height=10, center=(0, 0)) >>> rect1.compute_corners() [(2.0, 5.0), (2.0, -5.0), (-2.0, -5.0), (-2.0, 5.0)] ``` - + Just like any other Python object that we have encountered, we can put our `Rectangle`s in lists, store them as values in dictionaries, pass them to functions, reference them with multiple variables, and so on. diff --git a/Python/Module5_OddsAndEnds/WorkingWithFiles.md b/Python/Module5_OddsAndEnds/WorkingWithFiles.md index 887d5090..e8fce932 100644 --- a/Python/Module5_OddsAndEnds/WorkingWithFiles.md +++ b/Python/Module5_OddsAndEnds/WorkingWithFiles.md @@ -64,7 +64,7 @@ WindowsPath('data/data1.txt') See that the `/` operator, when used in conjunction with a `Path` instance, created a new path with the appropriate path-separator for the present OS. This is extremely convenient! Let's proceed to explore some other useful methods that `Path` provides us with. These methods enable us to inspect directories and files, create new directories, list all of the files in a directory, open files to for reading/writing, and much more. A complete listing of these methods can be found [here](https://docs.python.org/3/library/pathlib.html#methods-and-properties) and [here](https://docs.python.org/3/library/pathlib.html#methods), collectively; it is highly recommended that you take time to look through them. - + ```python >>> root = Path(".") @@ -99,6 +99,7 @@ WindowsPath('C:/Users/TerranceWasabi/Desktop/PLYMI/Module5_OddsAndEnds/data/data 'data\\data1.txt' ``` +
diff --git a/Python/conf.py b/Python/conf.py index 24a6b9eb..66fd6d6b 100644 --- a/Python/conf.py +++ b/Python/conf.py @@ -43,7 +43,7 @@ '.md': lambda s: jupytext.reads(s, '.md'), } -nbsphinx_allow_errors = True +nbsphinx_allow_errors = False # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates']