-
Notifications
You must be signed in to change notification settings - Fork 1
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
Added feature to create table directly from Pandas DataFrame #3
Conversation
Sorry, hadn't thought about the test coverage, I'll sort that out and add it to this. |
Hey @nik849 thanks for working on this! I am thinking if it would be better to add a new argument to the def new(headings: Optional[List[Any]] = None,
data: Optional[List[List[Any]]] = None,
style: Text = 'default',
device: Text = 'stdout',
dataframe: Optional[Pandas.DataFrame] = None) -> TableD:
...
>>> tabled.new(dataframe=new_df) Looks great otherwise, just need some tests. |
@tommyip , great, I will do that, I think it will be a fair bit neater that way. I think it will also be easier to test. |
Looks great, I think the conversion should happen in the api function instead of the TableD constructor, but it is fine otherwise. Just need some test and then I am happy to merge this, I can do that if you like. |
Ok, I'll swap those bits round and commit those, could you write the test method? I'm not that familiar with the testing side. I'll do it now, thanks |
@tommyip, great, thanks! |
Added new method to the api, accepts a pandas DataFrame object and returns a new table object.