SELECT customerName
FROM customers
WHERE country NOT IN ('GERMANY');
EVALUATE
SELECTCOLUMNS(
FILTER(
Customer,
NOT Customer[CountryRegion] IN {"GERMANY"}
),
"CustomerName", Customer[Name]
)
import pandas as pd
df = pd.read_csv('customers.csv')
# Filter the DataFrame to exclude rows where country is 'GERMANY'
result = df[~df['country'].isin(['GERMANY'])][['customerName']]
# Convert to a list of lists
result_list = result.values.tolist()
print(result_list)
| John Doe |
| Jane Smith |
| Bob Brown |
| Alice White |
FILTER(Customers, NOT Customers[country] IN {"GERMANY"}): Filters the Customers table to exclude rows where the country is 'GERMANY'. SELECTCOLUMNS: Selects the customerName column and returns it as "CustomerName" in the output.
Leave a Comment