(func_name, columns, df)
return func_text, global_vars
Example if generated implementation
        def _df_isna_impl(df):
          data_0 = df._data[0][0]
          series_0 = pandas.Series(data_0)
          result_0 = series_0.isna()
          data_1 = df._data[1][0]
          series_1 = pandas.Series(data_1)
          result_1 = series_1.isna()
          return pandas.DataFrame({"A": result_0, "B": result_1}, index=df._index)
Example if generated implementation
        def _df_isna_impl(df):
          data_0 = df._data[0][0]
          series_0 = pandas.Series(data_0)
          result_0 = series_0.isna()
          data_1 = df._data[1][0]
          series_1 = pandas.Series(data_1)
          result_1 = series_1.isna()
          return pandas.DataFrame({"A": result_0, "B": result_1}, index=df._index)
Example if generated implementation def _df_isna_impl ( df ) : data_0 = df . _data [ 0 ] [ 0 ] series_0 = pandas . Series ( data_0 ) result_0 = series_0 . isna () data_1 = df . _data [ 1 ] [ 0 ] series_1 = pandas . Series ( data_1 ) result_1 = series_1 . isna () return pandas . DataFrame ( { A : result_0 B : result_1 } index = df . _index )
def _dataframe_codegen_isna(func_name, columns, df):
    """
    Example if generated implementation
        def _df_isna_impl(df):
          data_0 = df._data[0][0]
          series_0 = pandas.Series(data_0)
          result_0 = series_0.isna()
          data_1 = df._data[1][0]
          series_1 = pandas.Series(data_1)
          result_1 = series_1.isna()
          return pandas.DataFrame({"A": result_0, "B": result_1}, index=df._index)
    """
    results = []
    func_lines = [f'def _df_{func_name}_impl(df):']
    index = 'df._index'
    for i, c in enumerate(columns):
        col_loc = df.column_loc[c]
        type_id, col_id = col_loc.type_id, col_loc.col_id
        result_c = f'result_{i}'
        func_lines += [f'  data_{i} = df._data[{type_id}][{col_id}]',
                       f'  series_{i} = pandas.Series(data_{i})',
                       f'  {result_c} = series_{i}.{func_name}()']
        results.append((columns[i], result_c))

    data = ', '.join(f'"{col}": {data}' for col, data in results)
    func_lines += [f'  return pandas.DataFrame({{{data}}}, {index})']
    func_text = '\n'.join(func_lines)
    global_vars = {'pandas': pandas}

    return func_text, global_vars
def _dataframe_codegen_isna ( func_name , columns , df ) : results = [ ] func_lines = [ f'def _df_{func_name}_impl(df):' ] index = 'df._index' for i , c in enumerate ( columns ) : col_loc = df . column_loc [ c ] type_id , col_id = col_loc . type_id , col_loc . col_id result_c = f'result_{i}' func_lines += [ f'  data_{i} = df._data[{type_id}][{col_id}]' , f'  series_{i} = pandas.Series(data_{i})' , f'  {result_c} = series_{i}.{func_name}()' ] results . append ( ( columns [ i ] , result_c ) ) data = ', ' . join ( f'"{col}": {data}' for col , data in results ) func_lines += [ f'  return pandas.DataFrame({{{data}}}, {index})' ] func_text = '\n' . join ( func_lines ) global_vars = { 'pandas' : pandas } return func_text , global_vars