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  

1  creating xls files: 

2  

3  import numpy as np 

4  import pandas as pd 

5  

6  x = np.linspace(0,2*np.pi,100) 

7  y = np.sin(x) 

8  

9  df = pd.DataFrame({'x'=x,'y'=y}) 

10  

11  writer1 = pd.ExcelWriter('sinewave.xlsx', engine='xlsxwriter') 

12  df.to_excel(writer1,sheet_name='Sheet1') 

13  writer1.close() 

14  

15  y = np.exp(x)*np.cos(2*np.pi*x) 

16  

17  df3 = pd.DataFrame({'x':x,'y':y}) 

18  

19  writer3 = pd.ExcelWriter('dampedcosinewave.xlsx', engine='xlsxwriter') 

20  df3.to_excel(writer3,sheet_name='Sheet1') 

21  writer3.close() 

Note: See
TracBrowser
for help on using the repository browser.