Free DSA-C02 Exam Braindumps (page: 8)

Page 7 of 17

Mark the incorrect statement regarding Python UDF?

  1. Python UDFs can contain both new code and calls to existing packages
  2. For each row passed to a UDF, the UDF returns either a scalar (i.e. single) value or, if defined as a table function, a set of rows.
  3. A UDF also gives you a way to encapsulate functionality so that you can call it repeatedly from multiple places in code
  4. A scalar function (UDF) returns a tabular value for each input row

Answer(s): D

Explanation:

A scalar function (UDF) returns one output row for each input row. The returned row consists of a single column/value



Data Scientist can query, process, and transform data in a which of the following ways using Snowpark Python. [Select 2]

  1. Query and process data with a DataFrame object.
  2. Write a user-defined tabular function (UDTF) that processes data and returns data in a set of rows with one or more columns.
  3. SnowPark currently do not support writing UDTF.
  4. Transform Data using DataIKY tool with SnowPark API.

Answer(s): A,C

Explanation:

Query and process data with a DataFrame object. Refer to Working with DataFrames in Snowpark Python.
Convert custom lambdas and functions to user-defined functions (UDFs) that you can call to process data.
Write a user-defined tabular function (UDTF) that processes data and returns data in a set of rows with one or more columns.
Write a stored procedure that you can call to process data, or automate with a task to build a data pipeline.



Which Python method can be used to Remove duplicates by Data scientist?

  1. remove_duplicates()
  2. duplicates()
  3. drop_duplicates()
  4. clean_duplicates()

Answer(s): D

Explanation:

The drop_duplicates() method removes duplicate rows.
dataframe.drop_duplicates(subset, keep, inplace, ignore_index) Remove duplicate rows from the DataFrame:

1. import pandas as pd
2. data = {
3. "name": ["Peter", "Mary", "John", "Mary"],
4. "age": [50, 40, 30, 40],
5. "qualified": [True, False, False, False]
6. }
7.

8. df = pd.DataFrame(data)
9. newdf = df.drop_duplicates()



Consider a data frame df with 10 rows and index [ 'r1', 'r2', 'r3', 'row4', 'row5', 'row6', 'r7', 'r8', 'r9', 'row10'].
What does the aggregate method shown in below code do? g = df.groupby(df.index.str.len())

  1. aggregate({'A':len, 'B':np.sum})
  2. Computes Sum of column A values
  3. Computes length of column A
  4. Computes length of column A and Sum of Column B values of each group
  5. Computes length of column A and Sum of Column B values

Answer(s): C

Explanation:

Computes length of column A and Sum of Column B values of each group






Post your Comments and Discuss Snowflake DSA-C02 exam with other Community members:

DSA-C02 Discussions & Posts