<｜begin▁of▁sentence｜>### Instruction:
Given a directed graph with nodes `{0, 1, 2, 3}` and weighted edges `[(0, 1, 4.5), (1, 2, -1.2), (2, 3, 3.8), (3, 0, 5.1), (1, 3, 2.6)]`, how can you compute the shortest path lengths from every node to every other node using NetworkX?
### Response:
import networkx as nx

# Initialize a weighted graph
G = nx.DiGraph()
G.add_weighted_edges_from([
    (0, 1, 4.5),
    (1, 2, -1.2),
    (2, 3, 3.8),
    (3, 0, 5.1),
    (1, 3, 2.6),
])

# Compute the shortest path lengths between all pairs
lengths = dict(nx.all_pairs_bellman_ford_path_length(G, weight='weight'))

# Print the shortest path lengths from node 1 to all other nodes
for target in lengths[1]:
    print(f'Length from node 1 to node {target} is {lengths[1][target]}')
<|EOT|>
