pip install cytoolz
python
from cytoolz import pipe, map, curry
def transform_data(row):
return {
'name': row['name'],
'age': int(row['age']),
'email': row['email'].lower()
}
def filter_data(row):
return row['age'] >= 20
def map_data(row):
return f"Name: {row['name']}, Age: {row['age']}, Email: {row['email']}"
data = [
{'name': 'Alice', 'age': '25', 'email': 'alice@example.com'},
{'name': 'Bob', 'age': '18', 'email': 'bob@example.com'},
{'name': 'Charlie', 'age': '30', 'email': 'charlie@example.com'}
]
result = (
data
)
for item in result:
print(item)