Exam DP-600 Topic 1 Question 155 Discussion

Actual exam question for Microsoft's DP-600 exam
Question #: 155
Topic #: 1
Hotspot Question
You have a Fabric tenant that contains a lakehouse named Lakehouse1. Lakehouse1 contains a table named Nyctaxi_raw. Nyctaxi_row contains the following table:

You create a Fabric notebook and attach it to Lakehouse1.
You need to use PySpark code to transform the data. The solution must meet the following requirements:
- Add a column named pickupDate that will contain only the date portion of pickupDateTime.
- Filter the DataFrame to include only rows where fareAmount is a
positive number that is less than 100.
How should you complete the code? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.

Suggested Answer:

by Barnett at May 25, 2025, 09:06 AM

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Nick name: Submit Cancel
Catiasantos609
2025-06-14 13:33:28
it should be df.withcolumn, cast and filter ("fareAmount>0 AND fareAmount <100")

df.withcolumnsRenamed is used to change column name of an existent column, does not change data.
upvoted 1 times
...
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

0
0
0
10