hi
sth baffled me lately
import matplotlib.pyplot as plt
import numpy as np
years = np.array([1900 + x for x in range(126)])
degree = np.array([34])
change_degree = np.array([y for y in np.random.default_rng().uniform(-0.2, 0.3, 126)])
for change in change_degree:
next_index = degree[-1] + change
np.append(degree, next_index)
degree = degree[1:]
plt.plot(years, degree)
the code above doesnt work because the dimensions do not match, however the fix is:
# Wrong:
np.append(degree, new_value)
# Right:
degree = np.append(degree, new_value)
but how? I'm new to stuff I could use some conceptual help with this