title: TypeError: edges() takes no keyword arguments
body: <p>I ran a sparsification algorithm on a graph and am trying to import the graph into CSV file as edgelist. When I use the .write_edlist() method in python networkx, I get the following error:</p>
  
  <pre><code>&gt; Traceback (most recent call last):   File
  &gt; "/Users/sindhuja/sparsegraph/sparsify.py", line 41, in &lt;module&gt;
  &gt;     nx.write_edgelist(S, 'sparsified_graph.csv')   File "&lt;decorator-gen-512&gt;", line 2, in write_edgelist   File
  &gt; "/Users/sindhuja/PycharmProjects/kit.py/venv/lib/python3.7/site-packages/networkx/utils/decorators.py",
  &gt; line 227, in _open_file
  &gt;     result = func_to_be_decorated(*new_args, **kwargs)   File "/Users/sindhuja/PycharmProjects/kit.py/venv/lib/python3.7/site-packages/networkx/readwrite/edgelist.py",
  &gt; line 177, in write_edgelist
  &gt;     for line in generate_edgelist(G, delimiter, data):   File "/Users/sindhuja/PycharmProjects/kit.py/venv/lib/python3.7/site-packages/networkx/readwrite/edgelist.py",
  &gt; line 114, in generate_edgelist
  &gt;     for u, v, d in G.edges(data=True): TypeError: edges() takes no keyword arguments
  </code></pre>
  
  <p>This is the code snippet I am running:</p>
  
  <pre><code>import csv
  from collections import defaultdict
  from typing import Dict, Any
  import pandas as pd
  from IPython.utils import data
  from networkit import *
  import numpy as np
  import networkx as nx
  from networkit.graphio import GraphConverter
  from numpy import genfromtxt
  import metis as mt
  from networkx.utils import make_str
  from _NetworKit import Graph
  
  df1 = pd.read_csv ( 'person_knows_person_0_0.csv', sep='|', index_col=False )
  df2 = pd.DataFrame ( df1 )
  src_list = df2[':START_ID(Person)'].values.tolist ()
  tgt_list = df2[':END_ID(Person)'].values.tolist ()
  
  print ( src_list[1] )
  print ( tgt_list[1] )
  f = open ( 'sample_ex.csv', 'w' )
  for (src, tgt) in zip ( src_list, tgt_list ):
      f.write ( str ( src ) + ',' + str ( tgt ) + '\n' )
  f.close ()
  reader = graphio.EdgeListReader ( ',', 1, continuous=False )
  G = reader.read ( 'sample_ex.csv' )
  print ( G )
  graphio.writeGraph ( G, 'newgraph.graph', Format.METIS )
  metisgraph = graphio.readGraph ( "newgraph.graph", Format.METIS )
  print ( metisgraph )
  G.indexEdges ()
  print ( "Original size: ", G.size () )
  
  sparsificationAlgorithm = sparsification.LocalDegreeSparsifier ()
  S = sparsificationAlgorithm.getSparsifiedGraph ( G, 0.5 )
  print ( "Sparsified size: ", S.size () )
  
  
  nx.write_edgelist(S, 'sparsified_graph.edgelist', ',')
  </code></pre>
  
  <p>I am new to networkx and it could be that I am not passing arguments to write_edgelist() method properly. Could some help me?</p>