SELECT customerName
FROM customers
WHERE country IN ('France', 'India', 'Poland');
EVALUATE
SELECTCOLUMNS(
FILTER(
Customer,
Customer[CountryRegion] IN {"France", "India", "Poland"}
),
"CustomerName", Customer[Name]
)
import pandas as pd
df = pd.read_csv('customers.csv')
# Filter the DataFrame to include rows where country is in the specified list
result = df[df['country'].isin(['France', 'India', 'Poland'])][['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, Customers[country] IN {"France", "India", "Poland"}): Filters the Customers table to include rows where the country is either 'France', 'India' or 'Poland'. SELECTCOLUMNS: Selects the customerName column and returns it as "CustomerName" in the output.
Leave a Comment