I have generated a random graph, how can I save it to a csv file?
g=networkx.erdos_renyi_graph(100,.3)
Normally you store networkx graphs as edge-list - there is a dedicated method to do that (and read it back in as well):
import networkx as nx
g=nx.erdos_renyi_graph(100,.3)
nx.write_edgelist(g, "file.csv")
See
If you really need a csv, this might help.