I need to create a new dataframe with the lines that were not included in the dataframe ''results'' but are on the dataframe ''df'' without creating a new filter.
I have no idea how to do it. Can you help me out? (sorry if noob question)
import pandas as pd
#Creating dataframe
d = {'col1': [1, 2,3,4,5,6,7,8,9,10], 'col2': ['a','b','b','b','c','d','c','a','z','c']}
df = pd.DataFrame(data=d)
#Finding the lines that contain a certain letter
a = df[df['col2'].str.contains("a")]
b = df[df['col2'].str.contains("b")]
c = df[df['col2'].str.contains("c")]
#Merge the 3 data frames
frames = [a, b, c]
results = pd.concat(frames)
print(results)