Skip to content

Commit 1e8ad89

Browse files
Handle float and series confidence intervals
1 parent f616091 commit 1e8ad89

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

causal_testing/testing/causal_test_result.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,18 @@ def to_dict(self, json=False):
9999
def ci_low(self):
100100
"""Return the lower bracket of the confidence intervals."""
101101
if self.confidence_intervals:
102-
return self.confidence_intervals[0][0]
102+
try:
103+
return self.confidence_intervals[0][0]
104+
except TypeError:
105+
return self.confidence_intervals[0]
103106
return None
104107

105108
def ci_high(self):
106109
"""Return the higher bracket of the confidence intervals."""
107-
if self.confidence_intervals:
110+
try:
108111
return self.confidence_intervals[1][0]
112+
except TypeError:
113+
return self.confidence_intervals[1]
109114
return None
110115

111116
def ci_valid(self) -> bool:

0 commit comments

Comments
 (0)