I have a dataset(pickle format) containing float('nan'), and I need to remove it.
It is possible to add float('nan') to a graph as a node in networkx. However, I don't know how to remove it.
import networkx as nx
G = nx.Graph()
G.add_node(float('nan'))
print(G.nodes) # [nan], so there is float('nan') in the graph
G.remove_node(float('nan')) # this statement raise a NetworkxError showing nan not in the graph
Code and data in CoReRank-WSDM-2019 and BirdNest.
Could anyone help me with this problem? Thank you in advance.