<｜begin▁of▁sentence｜>### Instruction:
Given a graph with 10 vertices named from 'A' to 'J' and each vertex having an 'age' attribute with values [28, 34, 29, 32, 31, 27, 36, 30, 33, 35], how can you export the vertices with their attributes to a pandas DataFrame using igraph, and then set the DataFrame's index to the vertex names?
### Response:
from igraph import Graph
import pandas as pd

# Create a graph
g = Graph.Erdos_Renyi(n=10, p=0.5)

# Add some vertex attributes
g.vs['name'] = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J']
g.vs['age'] = [28, 34, 29, 32, 31, 27, 36, 30, 33, 35]

# Export vertices with attributes to pandas DataFrame
vertex_df = g.get_vertex_dataframe()

# Use vertex names as index
vertex_df.index = g.vs['name']

print(vertex_df)
<|EOT|>
