Skip to content
Snippets Groups Projects
Commit f48bdb57 authored by Frank Sauerburger's avatar Frank Sauerburger
Browse files

Fix syntax highlighting

Some markdown code block language indications were missing or invalid. This
commit fixes them. In most cases, they the syntax should be python.
parent df19fccb
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -120,7 +120,7 @@ Assume, we want to calculate the square root of all these numbers. We can
simply use numpy's `sqrt` method do perform the same operation on all elements
of the array at the same time.
<!-- append np_arrays.py -->
```pyton
```python
# Calculte the square root for each item in the array numbers.
roots = np.sqrt(numbers)
```
......@@ -128,7 +128,7 @@ roots = np.sqrt(numbers)
Since the resulting variable `roots` is also a numpy array, we can perform
similar operations on this variable.
<!-- append np_arrays.py -->
```pyton
```python
# Perform other calucaltions for each element separately.
something_else = 1.5 * roots - 4
```
......@@ -439,7 +439,7 @@ free parameters of the model. The return value corresponds to the $`y`$-value, i
our case the expected number of events.
<!-- append decay.py -->
```
```python
def model(channel, m, s, A, y0, b):
return A * np.exp(-0.5 * (channel - m)**2 / s**2) + y0 + b * channel
```
......@@ -470,7 +470,7 @@ stable fit result. More information on the fitting method can be found in the
[documentation](https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.curve_fit.html).
<!-- append decay.py -->
```
```python
# Define the intial values of the free parameters.
# Remember, that we defined our model as n(c; m, s, A, y0, b)
p0 = (60, 10, 50, 20, 1)
......@@ -488,7 +488,7 @@ To visualize the fitted model, we need to evaluate our model with the optimized
parameters `popt`.
<!-- append decay.py -->
```
```python
# Evaluate the model with the optimized parameter.
fit_count = model(channel, *popt)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment