…or the notnull function:data2c = data[pd.notnull(data["x2"])] # Apply notnull() function print(data2c) # Print updated DataFrameAll the previous Python codes lead to the same output DataFrame.Example 3: Drop
On the above DataFrame, we have a total of 10 rows with 2 rows having all values duplicated, performing distinct on this DataFrame should get us 9 after removing 1 duplicate row. # Applying distinct() to remove duplicate rows distinctDF = df.distinct() print("Distinct count: "+str(distinc...