-
Notifications
You must be signed in to change notification settings - Fork 13
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
Maybe drop pandas #35
Comments
thoughts @ethanwhite ? |
I think just returning dicts is good. Easy enough to convert to dataframes if the format matches what Pandas takes. |
thanks! will do then |
Awe. But I like Pandas! |
doesn't it seem like a heavy dependency though? |
It is, darn it. Is the use-case of pytaxize without Pandas particularly appealing? As long as it still plays nice with Pandas by default, I suppose it doesn't need to be required per se. |
It also depends on how closely you want it to reflect the R package. If you want it be pretty close, DataFrames are the logical way to make Python behave in an R-ish kind of way. |
Indeed, the R client is focused on data.frame outputs, so in that way using pandas makes it more similar to that. How common will it be for the same person to be switching between taxize and pytaxize? Or is the most common case any one person uses one or the other? Do you think returning dicts is the most idiomatic python? That is, is that what someone would expect to get back by default? Dropping pandas makes this library simpler and easier to maintain, so that's a + for dropping |
Thanks for creating this package, I just came across it today. I definitely see the case for making the library simpler and easier to maintain but my personal preference would be to maintain the option of getting a pandas dataframe returned if at all possible. I think it is becoming idiomatic, especially in the python data science community, to use pandas dataframes as inputs and returns for functions. If I can be of assistance in maintaining or testing, please let me know. |
@ColinTalbert thanks for your thoughts. Two votes to keep pandas, so i'm willing to keep it. Maybe it makes sense to allow user to say whether they want a pandas dataframe back or a dict?
Thanks for the issue #43 - that kind of help is great! using and reporting bugs. Also, any feature requests is great. There are still many things to port over from |
One option I've seen and liked is including an optional parameter to If you used this I think you could also set up the pandas import as Colin Talbert USGS Fort Collins Science Center USGS North Central Climate Science Center Work schedule: On Wed, Oct 26, 2016 at 10:41 AM, Scott Chamberlain <
|
As a parameter sounds good to me! ✔️ |
how do you do optional imports in a python library? |
something along the lines of: try: except ImportError: Colin Talbert USGS Fort Collins Science Center USGS North Central Climate Science Center Work schedule: On Thu, Oct 27, 2016 at 9:56 AM, Scott Chamberlain <notifications@github.com
|
and then in in code: if not pd: Colin Talbert USGS Fort Collins Science Center USGS North Central Climate Science Center Work schedule: On Thu, Oct 27, 2016 at 9:58 AM, Talbert, Colin talbertc@usgs.gov wrote:
|
ah, okay |
I've taken a stab at implementing this, take a look at: There are obviously many functions in the itis module that would need this change, let alone the modules for other services. If this seems like a workable design pattern, I'll see what I can do to add this functionality to the rest of the itis functions, before submitting a pr. |
thanks @ColinTalbert - looks good, though can we shorten the param i realized that there's at least some, didn't look thoroughly through package, internal munging of data with |
don't we also need |
Yes, good point. I'll throw that in as well. Colin Talbert USGS Fort Collins Science Center USGS North Central Climate Science Center Work schedule: On Fri, Oct 28, 2016 at 12:38 PM, Scott Chamberlain <
|
Why is this thread still open? :( Why can't we sort this out? has there been a pull |
@dheerajpai if @ColinTalbert send a PR we can discuss that. if we don't hear from him soon I can go ahead and do it |
very heavy dependency, and probably more idiomatic python to just return dicts
The text was updated successfully, but these errors were encountered: