Creating a Function : DataFrame

Creating a Function : DataFrame PRODUCT     AVGIDEA, INC. 

DataFrame functions can receive the content of the CSV file as a Pandas DataFrame. This function is useful to use in conjunction with "query", "load" and "save" function to load and save data to external databases.


Creating a DataFrame Function

1. Login to the ADP console and select the "Function" -> "Editor" menu.


2. Enter the details of the function, and click the "SAVE" button.

Name : Name of the function

Description : Description of the function

Function Type : DataFrame

3. (Optional) Click on the Attach File button to attach a custom Python package to the function as a Zip file.

* AI models can be included in the package and loaded from within the function.


4. Enter any Python program in the text area.

The sample on the left shows the code running association analysis using mlxtend and save output Pandas DataFrame to Google Bigquery defined as a DataSource.


5. Click the "SAVE" button to save the function.

Available Functions and Objects

The following is a list of functions and objects that can be used in the File function.

path : Directory where custom packages are located

out(string) : Output function to output file

log(string) : Output function to execution log

upload(string) : Function to upload locally located files to Storage

query(datasource string, querystr string) : Submit a query to the database defined by DataSource. Resultset is returned as a Pandas DataFrame.

save(datasource string, df DataFrame) : Function to save DataFrame to a specified DataSource.