You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/salmon.ipynb
+36-36Lines changed: 36 additions & 36 deletions
Original file line number
Diff line number
Diff line change
@@ -107,7 +107,7 @@
107
107
},
108
108
{
109
109
"cell_type": "code",
110
-
"execution_count": 10,
110
+
"execution_count": 5,
111
111
"metadata": {},
112
112
"outputs": [],
113
113
"source": [
@@ -124,7 +124,7 @@
124
124
},
125
125
{
126
126
"cell_type": "code",
127
-
"execution_count": 24,
127
+
"execution_count": 6,
128
128
"metadata": {},
129
129
"outputs": [],
130
130
"source": [
@@ -141,7 +141,7 @@
141
141
},
142
142
{
143
143
"cell_type": "code",
144
-
"execution_count": 14,
144
+
"execution_count": 7,
145
145
"metadata": {},
146
146
"outputs": [],
147
147
"source": [
@@ -161,16 +161,16 @@
161
161
"source": [
162
162
"## Modeling changes\n",
163
163
"\n",
164
-
"To see how the population changes from year-to-year, I'll use `diff` to compute the absolute difference between each year and the next.\n"
164
+
"To see how the population changes from year-to-year, I'll use `diff` to compute the absolute difference between each year and the next and `shift` to align the changes with the year they happened."
165
165
]
166
166
},
167
167
{
168
168
"cell_type": "code",
169
-
"execution_count": 25,
169
+
"execution_count": 8,
170
170
"metadata": {},
171
171
"outputs": [],
172
172
"source": [
173
-
"abs_diffs = pop_series.diff()\n",
173
+
"abs_diffs = pop_series.diff().shift(-1)\n",
174
174
"abs_diffs"
175
175
]
176
176
},
@@ -183,7 +183,7 @@
183
183
},
184
184
{
185
185
"cell_type": "code",
186
-
"execution_count": 26,
186
+
"execution_count": 9,
187
187
"metadata": {},
188
188
"outputs": [],
189
189
"source": [
@@ -195,12 +195,13 @@
195
195
"cell_type": "markdown",
196
196
"metadata": {},
197
197
"source": [
198
-
"These relative differences are observed annual net growth rates. So let's drop the `0` and save them."
198
+
"These relative differences are observed annual net growth rates.\n",
0 commit comments