Pandas CSV Export

Let's start by importing pandas and numpy.

import pandas as pd
import numpy as np
0.3s
Python

Then we're generating a data frame with 100 rows and returning that.

rows = 100
dates = pd.date_range('20130101', periods=rows)
df = pd.DataFrame(np.random.randn(rows, 4), index=dates, columns=list('ABCD'))
df
1.0s
Python

Nextjournal automatically converts a pandas data frame into a CSV. To download it just select click […] next to the table and select file, then click the download icon.

Runtimes (1)