Examples
Dataframe to csv:

In [1]:
import numpy as np
import pandas as pd
In [2]:
df = pd.DataFrame({'name': ['Leonardo', 'Michelangelo'],
                   'mask': ['blue', 'orange'],
                   'weapon': ['katana', 'nunchaku']})
df.to_csv(index=False)
Out[2]:
'name,mask,weapon\r\nLeonardo,blue,katana\r\nMichelangelo,orange,nunchaku\r\n'

Pandas: Dataframe - to csv.