<｜begin▁of▁sentence｜>### Instruction:
Given edge data with columns 'source', 'target', and 'weight', along with vertex data containing 'name' and 'attribute', how can you create an undirected graph using the DataFrame method in igraph, and can you print out the graph structure?
### Response:
import pandas as pd
from igraph import Graph

# Sample data for edges
edges_data = {'source': [0, 1, 2], 'target': [1, 2, 3], 'weight': [1.5, 2.0, 2.5]}
edges_df = pd.DataFrame(edges_data)

# Sample data for vertices
vertices_data = {'name': ['A', 'B', 'C', 'D'], 'attribute': [10, 20, 30, 40]}
vertices_df = pd.DataFrame(vertices_data)

# Create graph from dataframes
g = Graph.DataFrame(edges_df, directed=False, vertices=vertices_df, use_vids=True)
print(g)
<|EOT|>
