<｜begin▁of▁sentence｜>### Instruction:
Given a graph with edge set [(1, 2, 1.0), (1, 3, 2.0), (2, 4, 1.5), (3, 4, 2.5), (3, 5, 1.0)], can you generate an ego graph for node 1 with a radius of 2, including the edge data?
### Response:
import networkx as nx

# Create a graph
G = nx.Graph()
G.add_weighted_edges_from([(1, 2, 1.0), (1, 3, 2.0), (2, 4, 1.5), (3, 4, 2.5), (3, 5, 1.0)])

# Generate ego graph for node 1 with radius 2
H = nx.ego_graph(G, 1, radius=2)

# Print the edges of the ego graph
print(H.edges(data=True))
<|EOT|>
