Question & Answer
Question
I have following simple Notebook to save Pandas DataFrame to CSV data set in Project's Assets.

By running above code, I could correctly create a CSV data set on my Project's Assets

However, when I clicked this data set to preview it in Refinery, it failed and following error occurred:

Could you tell me how to save Pandas DataFrame to Watson Studio Local 1.2.3.1 Data Set correctly?
Cause
By default the Pandas df.to_csv() function includes the index field while exporting Pandas Data Frame to CSV file. However, since this index fields doesn't have column name, the csv file contains null as the field name of index column. The Watson Studio Local 1.2.3.1 Refinery error occurred because it could not parse the csv with null field name.
Answer
This issue can be solved by dropping the index column when exporting the Pandas DataFrame to CSV file.

Confirm Data Set created

Confirmed Refinery can open this Data Set correctly

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSHGWL","label":"IBM Watson Studio Local"},"Component":"Jupyter Notebook, Refinery","Platform":[{"code":"PF016","label":"Linux"}],"Version":"WSL 1.2.3.1","Edition":"N\/A","Line of Business":{"code":"LOB10","label":"Data and AI"}}]
Was this topic helpful?
Document Information
Modified date:
09 February 2020
UID
ibm11846365