-
-
Notifications
You must be signed in to change notification settings - Fork 991
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Q: Re Python Script widget - pandas dataframe to out_data #2932
Comments
With a recent version, this should mostly work: from Orange.data.pandas_compat import table_from_frame
table = table_from_frame(df) |
@kernc Where does one set continuous/discrete and feature/meta/class? |
You prepare the columns beforehand on the frame. |
@kernc And that's exactly why I asked for a full working example from the community, instead of incomplete two-liners with comments like, you need to do X first, followed by Y, and perhaps Z. P.S. Why don't you change your problematic avatar - imagine one browsing this post at work and a manager passing by. How's your avatar beneficial to Orange? |
Beg your pardon? |
@kernc , I can not find out "table_from_frame" function in help documention, https://docs.orange.biolab.si/3/data-mining-library/reference/data.html. In here, I get it. |
It should be imported as: |
For me, this works. @dsanalytics If you think something else should be added, please provide a detailed description. |
table_from_frame does work, but the output when connected to a Data Table widget, does not have the column names? How to include these? I am using the in_data to create something different with different column names (feature names). How can I include these new feature names? Thanks for the help. |
Same question as pchristian4481. How do I retain column names? when I link this downstream? |
This works. Might help others import random colnames = [i.name for i in in_data.domain] from Orange.data import Domain, Table out_data = Orange.data.Table(domain, df, in_data.Y) out_data = Table(domain, out_data) |
Is there a code example converting pandas dataframe to out_data? What I'm trying to accomplish is to get data from MySql using Python Script widget and then pass it to e.g. Data Sampler, Impute, etc.
Thank you.
The text was updated successfully, but these errors were encountered: