Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Chris Jewell
covid19uk
Commits
37b30227
Commit
37b30227
authored
Mar 16, 2021
by
Chris Jewell
Browse files
Add numpy conversion in `predict.py`
parent
28a51bd1
Changes
1
Hide whitespace changes
Inline
Side-by-side
covid/tasks/predict.py
View file @
37b30227
...
...
@@ -77,7 +77,7 @@ def predict(data, posterior_samples, output_file, initial_step, num_steps):
)
prediction
=
xarray
.
DataArray
(
predicted_events
,
predicted_events
.
numpy
()
,
coords
=
[
np
.
arange
(
predicted_events
.
shape
[
0
]),
covar_data
.
coords
[
"location"
],
...
...
@@ -87,7 +87,7 @@ def predict(data, posterior_samples, output_file, initial_step, num_steps):
dims
=
(
"iteration"
,
"location"
,
"time"
,
"event"
),
)
estimated_init_state
=
xarray
.
DataArray
(
estimated_init_state
,
estimated_init_state
.
numpy
()
,
coords
=
[
np
.
arange
(
estimated_init_state
.
shape
[
0
]),
covar_data
.
coords
[
"location"
],
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment