Combining Multidimensional Arrays | Sample Use Cases | Open Analytics Framework on VantageCloud Lake - Combining Multidimensional Arrays - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
ft:locale
en-US
ft:lastEdition
2024-12-11
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

Use case: You want to combine multidimensional arrays into a single array.

The ‘abind’ library is a generalization of the ‘cbind’ and ‘rbind’ libraries. It works with vectors, matrixes, and higher-dimensional arrays. It also provides functions 'adrop', 'asub', and 'afill' for manipulating, extracting and replacing data in arrays.

For this task, assume:
  • The abind R script "abind.R" is stored on a client’s machine.
  • The requirement file "reqs_abind_R.txt" is stored on client’s machine.
Prerequisite steps:
  • Connect from a client to a target VantageCloud Lake system where the task will be performed.
  • Import necessary modules on the client for the current use case.
    from teradatasqlalchemy.types import VARCHAR
  • Specify as a variable the path where the script and model files are kept on the client.
    path_to_files = '/Users/JaneDoe/OpeanAFexamples/scripts/'
  • Specify as a variable the path where the requirement file is stored on the client.
    path_to_reqsfiles = '/Users/JaneDoe/OpeanAFexamples/reqsfiles/'