Python Tile
Tring to split the values in a column into multiple rows using explode and I keep getting an error. I am not too familiar with the python tiles...
The value in my row will be "A<br>B" and I want them to appear as two separate rows, one with A and one with B.
Getting error:
"00:00:01.817 domomagic: Version 0.3 00:00:01.819 Traceback (most recent call last): 00:00:01.819 File "<stdin>", line 10, in <module> 00:00:01.819 File "/opt/conda/envs/legacy/lib/python3.7/site-packages/pandas/core/generic.py", line 5067, in __getattr__ 00:00:01.819 return object.__getattribute__(self, name) 00:00:01.820 AttributeError: 'DataFrame' object has no attribute 'explode'
My code is:
# Import the domomagic package into the script
from domomagic import *
import pandas as pd
# read data from inputs into a data frame
input1 = read_dataframe('DataFlows')
# write your script here
df = pd.DataFrame(input1)
df.explode('input_datasources')
output = pd.DataFrame(df)
# write a data frame so it's available to the next action
write_dataframe(output)
**If this answer solved your problem be sure to like it and accept it as a solution!
Best Answers
-
send a support ticket. looks like it's an old build of Pandas?
Tutorial on how to do the thing in MySQL
To do it in MySQL 2.0
1) count the number of times <br> occurs. use a formula tile.
2) duplicate each row the number of times <br> occurs + 1 (use the countdown table described here, https://www.youtube.com/watch?v=cOiT3FjQ7K8&t=667s
3) use text processing to find the n'th value before or after the <br>
Jae Wilson
Check out my 🎥 Domo Training YouTube Channel 👨💻
**Say "Thanks" by clicking the ❤️ in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"1 -
Hi @Ashleigh
explode was introduced with pandas 0.25.0. It definitely looks like Domo has an older version of pandas. You can confirm the version they have installed using
pd.__version__
I'm in agreement with @jaeW_at_Onyx . Send a ticket to support. They might be able to configure a custom environment for you with the proper package versions you might need.
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**1
Answers
-
send a support ticket. looks like it's an old build of Pandas?
Tutorial on how to do the thing in MySQL
To do it in MySQL 2.0
1) count the number of times <br> occurs. use a formula tile.
2) duplicate each row the number of times <br> occurs + 1 (use the countdown table described here, https://www.youtube.com/watch?v=cOiT3FjQ7K8&t=667s
3) use text processing to find the n'th value before or after the <br>
Jae Wilson
Check out my 🎥 Domo Training YouTube Channel 👨💻
**Say "Thanks" by clicking the ❤️ in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"1 -
Hi @Ashleigh
explode was introduced with pandas 0.25.0. It definitely looks like Domo has an older version of pandas. You can confirm the version they have installed using
pd.__version__
I'm in agreement with @jaeW_at_Onyx . Send a ticket to support. They might be able to configure a custom environment for you with the proper package versions you might need.
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**1 -
Thanks @GrantSmith @jaeW_at_Onyx looks like its version 0.22.0. I will put in a ticket.
**If this answer solved your problem be sure to like it and accept it as a solution!
0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 616 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 738 Beast Mode
- 57 App Studio
- 40 Variables
- 685 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 47 Workflows
- 10 DomoAI
- 36 Predict
- 15 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 124 Manage
- 121 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive