Пример #1
0
 def test4(self):
     df = self.example_df
     out = add_expression_column(self.example_df, ['str2', 'num3', 'str3', 'num4'],
                                 [''' str1 || '_a' ''',
                                  ''' case when num1 > 2 then 100 else 0 end''',
                                  ''' cast(num1 as char)''',
                                  ''' cast(num1 as float)'''], expr_type='sqlite')['out_table']
Пример #2
0
 def test7(self):
     out = add_expression_column(self.example_df,
                                 ['new_num1', 'new_num2', 'new_num3', 'new_num4',
                                  'new_num5', 'new_num6', 'new_num7',
                                  'new_str1', 'new_str2'],
                                 ['log(num1)', 'exp(num1)', 'sin(num1)', 'cos(num1)',
                                  'sqrt(num1)', 'arctan(num1)', 'num1 in [1,3,5]',
                                  '''str1 in ['a', 'c']''', '''str1 in ['a', 'c'] & str1 in ['b', 'c']'''], expr_type='python')
Пример #3
0
 def test6(self):
     df = self.example_df
     out = add_expression_column(df, ['str10'], ['str1 || 100'])
     print(out['out_table'])
Пример #4
0
 def test1(self):
     out = add_expression_column(self.example_df, ['num3', 'num4'],
                                 ['log(num1)', 'sqrt(num3)'],
                                 expr_type='python')
     print(out['out_table'])
Пример #5
0
 def test6(self):
     df = self.example_df
     out = add_expression_column(df, ['str10'], ['str1 || 100'])