snowflake.snowpark.DataFrame.except_¶
- DataFrame.except_(other: DataFrame) DataFrame [source] (https://github.com/snowflakedb/snowpark-python/blob/v1.26.0/snowpark-python/src/snowflake/snowpark/dataframe.py#L2790-L2837)¶
Returns a new DataFrame that contains all the rows from the current DataFrame except for the rows that also appear in the
other
DataFrame. Duplicate rows are eliminated.Example:
>>> df1 = session.create_dataframe([[1, 2], [3, 4]], schema=["a", "b"]) >>> df2 = session.create_dataframe([[1, 2], [5, 6]], schema=["c", "d"]) >>> df1.subtract(df2).show() ------------- |"A" |"B" | ------------- |3 |4 | -------------
minus()
andsubtract()
are aliases ofexcept_()
.- Parameters:
other – The
DataFrame
that contains the rows to exclude.