Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
I hope this answer will help you even if you asked the questions several weeks ago.
I think you will be able to create what you expect by using a custom python recipe with the python library openpyxl to customize your data and export it.
Does anyone have an example of code they have used to do something like this?
I did find a Toward Data Science post that covers some of this from a formatting point of view.
The author of that artical seem to be using Pandas and xlswriter. They are using some code something like the below. (This is sort of psudocode and has not been tested, there would be additional stuff needed to write to a Dataiku Connection.)
import pandas as pd
file_name = "Cryptocurrency.xlsx"
sheet_name = "Summary"
# fill thedataframe with some content
master_df = pd.DataFrame()
master_df = master_df[['iso', 'name', 'ohlc_o', 'ohlc_h', 'ohlc_l', 'ohlc_c', 'change_percent']].reset_index(drop=True)
master_df.columns = ['Symbol', 'Name', 'Open', 'High', 'Low', 'Close', 'Pct_Change']
master_df.iloc[:, 2:] = master_df.iloc[:, 2:].apply(lambda x: round(x, 2))
master_df['Pct_Change'] = master_df['Pct_Change'] / 100
master_df = master_df.sort_values('Pct_Change', ascending=False).reset_index(drop=True)
#check the contents of the dataframe
#write the dataframe to a local (non DSS Managed File)
writer = pd.ExcelWriter(file_name, engine='xlsxwriter')
, startrow = 2, index = False)
Here is a link to the article I found
To do this with Dataiku DSS you will have to install the xlswriter code into a Dataiku code environment. This will take administrative rights on your instance to create and manage a python code environment.
Here is a bit of a tutorial on setting up code environments.
This shows an advanced example using a Dataiku connection and a stream.
This one also is using a Dataiku Connection and writes to SharePoint.
Finally there are some more examples in this post, it this cased writing to an SFTP swerver.
Good luck. Hope this helps. Let us know how you are getting along.