开始使用免费开始使用

Finding gaps in both DataFrames

For data quality checks, you want to see all rows from both DataFrames - listings without benchmarks and benchmarks without listings. This helps identify gaps before analysis.

polars is loaded as pl, and the DataFrames hotels and type_benchmarks are available for you.

本练习是课程的一部分

Data Transformation with Polars

查看课程

练习说明

  • Join hotels with type_benchmarks on type and beach, keeping all rows from both DataFrames.
  • Use coalesce=True to avoid duplicate join columns.

交互式实操练习

通过完成这段示例代码来试试这个练习。

# Keep all rows from both DataFrames
full_view = hotels.____(
    type_benchmarks,
    on=["type", "beach"],
    how="____",
    # Avoid duplicate columns
    coalesce=____
)

print(full_view.head())
编辑并运行代码