Skip to content
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

API: return_type argument in StringMethods.split() #9847

Closed
jorisvandenbossche opened this issue Apr 10, 2015 · 4 comments
Closed

API: return_type argument in StringMethods.split() #9847

jorisvandenbossche opened this issue Apr 10, 2015 · 4 comments
Labels
API Design Strings String extension data type and string data
Milestone

Comments

@jorisvandenbossche
Copy link
Member

xref #9667 Now we also have string methods available on the index, the possible options for return_type ('series', 'frame') are a bit confusing I think: it will be confusing for users to get a Index back even if he/she supplies return_type='series' on a Index.str.split, or to get a series back with Series.str.split(.., return_type='index')?

Possible ways to make this a better API:

  1. An expand keyword (or another name), that indicates for False: give same dimension back (so for series/index keep it a series/index), and for True: expand series to dataframe.
    This would then be a duplicate for return_type of course. But the return_type was only introduced in 0.15.1 (and for partition it is still in a PR), so if we want to change this: better now than later. Or has this ship sailed?

  2. easier solution of @jreback: return_type='same'|'expand' to satisfy this need? (and can be easily back-compat) -> so no need to change the name of the keyword, only the arguments.

@jorisvandenbossche jorisvandenbossche added API Design Strings String extension data type and string data labels Apr 10, 2015
@jorisvandenbossche jorisvandenbossche added this to the 0.16.1 milestone Apr 10, 2015
sreejata pushed a commit to sreejata/pandas that referenced this issue Apr 13, 2015
sreejata added a commit to LeadSift/pandas that referenced this issue Apr 13, 2015
Fix: pandas-dev#9847, adding a "same" and "expand" param to the StringMethods.spit
@jreback jreback modified the milestones: 0.17.0, 0.16.1 May 8, 2015
@jreback
Copy link
Contributor

jreback commented May 8, 2015

if someone wants to tackle this in next day ok, otherwise can deprecate in 0.17.0 (its a simple deprecation so no big deal, can accept both)

@jorisvandenbossche
Copy link
Member Author

IMO it would be really stupid do not do it kwow (giving users one release extra to get used to the to be deprecated keyword).
I can do it later this evening (or otherwise tomorrow certainly)

@jreback jreback modified the milestones: 0.16.1, 0.17.0 May 8, 2015
@sinhrks
Copy link
Member

sinhrks commented May 8, 2015

@jreback, @jorisvandenbossche I've worked on this, and issue a PR once the test has been passed.

@jreback
Copy link
Contributor

jreback commented May 9, 2015

closed by #10085

@jreback jreback closed this as completed May 9, 2015
yarikoptic added a commit to neurodebian/pandas that referenced this issue Jul 2, 2015
Version 0.16.1

* tag 'v0.16.1': (222 commits)
  RLS: v0.16.1 final
  DOC: missed merge in v0.16.1 whatsnew
  DOC: add v0.17.0.txt whatsnew (not in index yet though)
  BUG: Series.fillna() raises if given a numerically convertible string
  DOC: add docstring for PeriodIndex.asfreq
  more fixups
  Index repr: allow unequal number of elements on one line
  Change Index repr to adjust to string length
  fixup for CategoricalIndex merge
  formatting MultiIndex
  ENH: repr now shows index name pandas-dev#6482
  DOC: prepare for 0.16.1 release DOC: edits in v0.16.1 whatsnew
  DEPR: Deprecate str.split return_type pandas-dev#9847
  fix the inconsistency between code and description
  ENH: support str translate for StringMethods
  ENH: support StringMethods index and rindex
  Release note [ci skip]
  TST: using - rather than difference in tools/plotting.py
  DOC: additional whatsnew
  ENH: support __radd__ operation on Index (GH10083)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Design Strings String extension data type and string data
Projects
None yet
3 participants