<｜begin▁of▁sentence｜>### Instruction:
Given an edgelist file containing the edges of a graph, where each line represents an edge with an optional weight, how can you create a NetworkX graph from this edgelist by specifying the node type as integers and the edge weight as floats using NetworkX's read_edgelist function?
### Response:
import networkx as nx

# Path to the edgelist file
path = 'path_to_edgelist_file.edgelist'

# Read the edgelist into a NetworkX graph
G = nx.read_edgelist(path, nodetype=int, data=(('weight', float),))

# Print the edges with their associated weights
print(list(G.edges(data=True)))
<|EOT|>
