File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -623,8 +623,8 @@ def ccc(
623
623
X_numerical_type = None
624
624
if x .ndim == 1 and (y is not None and y .ndim == 1 ):
625
625
# both x and y are 1d arrays
626
- # TODO: remove assertions and raise exceptions
627
- assert x . shape == y . shape , "x and y need to be of the same size"
626
+ if not x . shape == y . shape :
627
+ raise ValueError ( "x and y need to be of the same size" )
628
628
n_objects = x .shape [0 ]
629
629
n_features = 2
630
630
@@ -640,10 +640,9 @@ def ccc(
640
640
# plus we have the features data type (numerical, categorical, etc)
641
641
642
642
if isinstance (x , np .ndarray ):
643
- assert get_feature_type_and_encode (x [0 , :])[1 ], (
644
- "If data is a 2d numpy array, it has to be numerical. Use pandas.DataFrame if "
645
- "you need to mix features with different data types"
646
- )
643
+ if not get_feature_type_and_encode (x [0 , :])[1 ]:
644
+ raise ValueError ("If data is a 2d numpy array, it has to be numerical. Use pandas.DataFrame if "
645
+ "you need to mix features with different data types" )
647
646
n_objects = x .shape [1 ]
648
647
n_features = x .shape [0 ]
649
648
You can’t perform that action at this time.
0 commit comments