Output from Python Tool
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Greetings!
I have reviewed other posts on this topic but did not find one that helped. My python code extracts data from a file and places it into a DataFrame. When the extraction completes, I use Alteryx.write to write the DataFrame out.
I want to save the output to a CSV file however the output from the Python tool is formatted with extra quotes and brackets (image below, some data is redacted with a yellow square) that make the CSV unusable in my instance.
Ideas on how to produce DataFrame output without extra characters?
Thanks!
Joe
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
If you want to do it with Alteryx tools you could follow it with two multi field formulas. One says Trim([_CurrentField_], "['") and the second says Trim([_CurrentField_], "']")
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks BrandonB!
With the addition of two Multi Field Formula tools, I successfully created a usable CSV file. I'll mark that as the solution.
I appreciate the solution but I was wondering if it was possible to change the formatting from the DataFrame. Perhaps a custom formatter that is called during the execution of Alteryx.write?
Thanks!
