Fabricテナントには、Lakehouse1という名前の湖畔の家が含まれています。Lakehouse1には、Nyctaxi_rawという名前のテーブルが含まれています。Nyctaxi_rawには、次の列が含まれています。

Fabricノートブックを作成し、lakehouse1に添付します。
データの変換にはPySparkコードを使用する必要があります。ソリューションは以下の要件を満たす必要があります。
* pickupDateTime の日付部分のみを含む pickupDate という名前の列を追加します。
* データフレームをフィルタリングして、fareAmountが100未満の正の数である行のみを含めるようにします。
コードを完成させるにはどうすればよいでしょうか?回答するには、回答欄で適切なオプションを選択してください。注:
正解ごとに1ポイント獲得できます。

正解:

Explanation:

Add the pickupDate column: .withColumn( " pickupDate " , df[ " pickupDateTime " ].cast( " date " )) Filter the DataFrame: .filter( " fareAmount > 0 AND fareAmount < 100 " ) In PySpark, you can add a new column to a DataFrame using the .withColumn method, where the first argument is the new column name and the second argument is the expression to generate the content of the new column. Here, we use the .cast( " date " ) function to extract only the date part from a timestamp. To filter the DataFrame, you use the .filter method with a condition that selects rows where fareAmount is greater than 0 and less than 100, thus ensuring only positive values less than 100 are included.