Closed sandeepny441 closed 9 months ago
How can you combine isin with the ~ operator to filter out rows where the city is either 'San Francisco' or 'Santa Clara'?
It is either or neither?, for either we dont need "~"
yeah it should have been neither i guess
import pandas as pd
data = { 'Store_ID': [101, 102, 103, 104, 105, 106, 107, 108, 109, 110], 'Store_Name': ['Walmart', 'Target', 'Costco', 'Aldi', 'Trader Joe\'s', 'Safeway', 'Kroger', 'Walmart', 'Whole Foods', 'Sprouts'], 'City': ['Los Angeles', 'San Francisco', 'San Diego', 'San Jose', 'Sacramento', 'Fresno', 'Oakland', 'Los Angeles', 'Santa Clara', 'Pasadena'], 'Annual_Revenue_Millions': [450, 320, 480, 190, 240, 260, 210, 400, 310, 150], 'Category': ['Supermarket', 'Department', 'Warehouse', 'Supermarket', 'Supermarket', 'Supermarket', 'Supermarket', 'Supermarket', 'Organic', 'Organic'] }
stores_df = pd.DataFrame(data)