<｜begin▁of▁sentence｜>### Instruction:
Given a directed graph whose edges are given as [(0, 1, 1.0), (1, 2, 1.0)], how can you compute the trophic differences of the edges using NetworkX?
### Response:
import networkx as nx

# Create a directed graph
G = nx.DiGraph()
# Adding edges with weight
G.add_weighted_edges_from([(0, 1, 1.0), (1, 2, 1.0)])

# Calculating the trophic levels of the nodes
nx.trophic_levels(G)

# Calculating the trophic differences of the edges
edge_trophic_diffs = nx.trophic_differences(G)

# Print the trophic differences
each_edge_trophic_diffs = {edge: f'{diff:.2f}' for edge, diff in edge_trophic_diffs.items()}
print(each_edge_trophic_diffs)
<|EOT|>
