Gandagorn commented on a change in pull request #1323:
URL: https://github.com/apache/systemds/pull/1323#discussion_r668238169



##########
File path: src/main/python/tests/examples/tutorials/test_adult.py
##########
@@ -387,6 +387,11 @@ def test_level2(self):
         
################################################################################################################
         X1, M1 = X1.transform_encode(spec=jspec)
 
+        # better alternative for encoding
+        # X1, M = F1.transform_encode(spec=jspec)
+        # X2 = F2.transform_apply(spec=jspec, meta=M)
+        # testX2 = X2.compute(True)

Review comment:
       Thank you!
   One problem still remains: The replace works for ">50K.", however it does 
not for "<=50K.". I played around a bit, and my guess is that the "<=" is 
interpreted as some kind of operator, because when I execute
   `F2 = F2.replace("\<=50K.", "<=50K")`
   I get this error
   
   > Exception       : An error occurred while calling o0.prepareScript.
   : org.apache.sysds.parser.ParseException: 
   The following 4 parse issues were encountered:
   #1 [line 2:32] [Syntax error] -> 
V1=replace(target=V0,pattern='\<=50K.',replacement='<=50K');
      no viable alternative at input 'V1=replace(target=V0,pattern==' 
([@25,226:226='=',<7>,2:32])
   #2 [line 2:32] [Syntax error] -> 
V1=replace(target=V0,pattern='\<=50K.',replacement='<=50K');
      extraneous input '=' expecting {'(', '[', '-', '+', '!', 'TRUE', 'FALSE', 
ID, INT, DOUBLE, COMMANDLINE_NAMED_ID, COMMANDLINE_POSITION_ID, STRING} 
([@25,226:226='=',<7>,2:32])
   #3 [line 2:32] [Validation error] -> 
V1=replace(target=V0,pattern='\<=50K.',replacement='<=50K');
      cannot parse the int value: '50K'
   #4 [line 2:35] [Syntax error] -> 
V1=replace(target=V0,pattern='\<=50K.',replacement='<=50K');
      extraneous input 'K' expecting {')', ',', '^', '-', '+', '%*%', '%/%', 
'%%', '*', '/', '>', '>=', '<', '<=', '==', '!=', '&', '&&', '|', '||'} 
([@27,229:229='K',<60>,2:35])




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@systemds.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to