<｜begin▁of▁sentence｜>### Instruction:
Given a graph with vertices labeled 'A' to 'F' and edges set as [(0, 1), (0, 2), (1, 3), (3, 4), (4, 5)], if you want to merge vertices 'A' and 'B' into a single vertex while averaging out their attributes, how would you use the contract_vertices method from igraph?
### Response:
from igraph import Graph

# Create a graph
vertices = ['A', 'B', 'C', 'D', 'E', 'F']
edges = [(0, 1), (0, 2), (1, 3), (3, 4), (4, 5)]
g = Graph(edges=edges)

# Define a mapping from old to new vertex IDs
# Vertices 'A' and 'B' will be merged into 'A-B'
mapping = [0, 0, 2, 3, 4, 5]

# Contract vertices based on the mapping
g.contract_vertices(mapping, combine_attrs='mean')

# Print the summarized graph
g.vs['name'] = ['A-B', 'C', 'D', 'E', 'F']
print(g)
<|EOT|>
