Skip to content

Commit

Permalink
Fixing python demo 6, where the multivariate array conversion wasn't …
Browse files Browse the repository at this point in the history
…working for Python3 with Jpype. Fixed to use recommended array conversion as per UseInPython wiki. Addresses issue raised in PR #87 also.
  • Loading branch information
jlizier committed Sep 5, 2022
1 parent 2b0a5cb commit 65aa685
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions demos/python/example6DynamicCallingMutualInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
# a. Initialise the calculator for a univariate calculation:
miCalc.initialise(1, 1)
# b. Supply the observations to compute the PDFs from:
miCalc.setObservations(univariateSeries1, univariateSeries2)
miCalc.setObservations(JArray(JDouble, 1)(univariateSeries1.tolist()), JArray(JDouble, 1)(univariateSeries2.tolist()))
# c. Make the MI calculation:
miUnivariateValue = miCalc.computeAverageLocalOfObservations()

Expand All @@ -103,7 +103,7 @@
# to use the required number of dimensions for each variable:
miCalc.initialise(len(jointVariable1Columns), len(jointVariable2Columns))
# b. Supply the observations to compute the PDFs from:
miCalc.setObservations(jointVariable1, jointVariable2)
miCalc.setObservations(JArray(JDouble, 2)(jointVariable1.tolist()), JArray(JDouble, 2)(jointVariable2.tolist()))
# c. Make the MI calculation:
miJointValue = miCalc.computeAverageLocalOfObservations()

Expand Down

0 comments on commit 65aa685

Please sign in to comment.