In [1]:
import numpy as np
import pandas as pd
In [2]:
df = pd.DataFrame(columns=['y'], index=np.arange(10), data=np.random.random(10) * 100)
df['y'] = df['y'].map(round)
df.head()
Out[2]:
In [3]:
df.to_csv('./data/bar.csv', index_label='x')
In [4]:
df = pd.DataFrame(columns=['y'], index=np.arange(100), data=sorted(np.random.random(100)**2))
df['y'] = df['y'].map(lambda x: round(x, 5))
df.head()
Out[4]:
In [5]:
df.to_csv('./data/line.csv', index_label='x')
In [6]:
df = pd.DataFrame(columns=['y'], index=np.arange(20), data=np.random.random(20))
df['y'] = df['y'].map(lambda x: round(x, 2))
df.head()
Out[6]:
In [7]:
df.to_csv('./data/scatter.csv', index_label='x')
In [8]:
df = pd.DataFrame(columns=['y1', 'y2', 'y3'], index=np.arange(100))
df['y1'] = pd.Series(sorted(np.random.random(100)*10)).map(lambda x: round(x, 2))
df['y2'] = pd.Series(sorted(np.random.random(100)*15)).map(lambda x: round(x, 2))
df['y3'] = pd.Series(sorted(np.random.random(100)*50)).map(lambda x: round(x, 2))
df.head()
Out[8]:
In [9]:
df.to_csv('./data/multiline.csv', index_label='x')