From 65aa685d11a808b7704aee05577101cdf030db52 Mon Sep 17 00:00:00 2001 From: jlizier Date: Mon, 5 Sep 2022 23:13:52 +1000 Subject: [PATCH] Fixing python demo 6, where the multivariate array conversion wasn't working for Python3 with Jpype. Fixed to use recommended array conversion as per UseInPython wiki. Addresses issue raised in PR #87 also. --- demos/python/example6DynamicCallingMutualInfo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/demos/python/example6DynamicCallingMutualInfo.py b/demos/python/example6DynamicCallingMutualInfo.py index e6e7e5a..292c3e9 100644 --- a/demos/python/example6DynamicCallingMutualInfo.py +++ b/demos/python/example6DynamicCallingMutualInfo.py @@ -92,7 +92,7 @@ miCalc = miCalcClass() # 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() @@ -103,7 +103,7 @@ miUnivariateValue = miCalc.computeAverageLocalOfObservations() # 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()