code: def tnet_to_nx(df, t=None):
      
      if t is not None:
          df = get_network_when(df, t=t)
      if 'weight' in df.columns:
          nxobj = nx.from_pandas_edgelist(
              df, source='i', target='j', edge_attr='weight')
      else:
          nxobj = nx.from_pandas_edgelist(df, source='i', target='j')
      return nxobj
docs: Creates undirected networkx object