source: trunk/examples/zoo/loader2/notes @ 6683

Last change on this file since 6683 was 6683, checked in by dkearney, 6 years ago

adding an example of using a loader to allow users to chose an example excel spreadsheet or upload their own. the uploaded file data is stored in the driver.xml. the simulation checks whether the user chose an example excel spreadsheet or uploaded thier own. if the user uploaded their own file, we write it to disk, then parse it using a pandas dataframe and finally load it into a Rappture Curve.

File size: 460 bytes
Line 
1creating xls files:
2
3import numpy as np
4import pandas as pd
5
6x = np.linspace(0,2*np.pi,100)
7y = np.sin(x)
8
9df = pd.DataFrame({'x'=x,'y'=y})
10
11writer1 = pd.ExcelWriter('sinewave.xlsx', engine='xlsxwriter')
12df.to_excel(writer1,sheet_name='Sheet1')
13writer1.close()
14
15y = np.exp(-x)*np.cos(2*np.pi*x)
16
17df3 = pd.DataFrame({'x':x,'y':y})
18
19writer3 = pd.ExcelWriter('dampedcosinewave.xlsx', engine='xlsxwriter')
20df3.to_excel(writer3,sheet_name='Sheet1')
21writer3.close()
Note: See TracBrowser for help on using the repository browser.