問題文
A retail analyst needs the rows of a product table where the identifier equals 1, written with the DataFrame API rather than a statement. Which expression style does the documentation show for the condition?
選択肢
- Call select with the column and then compare the resulting DataFrame to the value, since comparison on a DataFrame produces the filtered set.
- Pass the wanted value to the where method as a positional argument, letting the API match it against the first column.
- Pass a Python dictionary of column names and wanted values to the filter method, which the API converts into a predicate.
- Pass a column expression built with the col helper and the equality operator to the filter method.