Skip to content

ENH: Distinguish widths argument in read_fwf #35057

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

Closed
wants to merge 633 commits into from
Closed

ENH: Distinguish widths argument in read_fwf #35057

wants to merge 633 commits into from

Conversation

erfannariman
Copy link
Member

@erfannariman erfannariman commented Jun 29, 2020

@erfannariman
Copy link
Member Author

To start the discussion about the argument names, thought I make the changes and create a PR. To make it consistent, I changed colspecs to col_specs as well.

@erfannariman erfannariman changed the title Distinguish widths argument ENH: Distinguish widths argument in read_fwf Jun 29, 2020
@WillAyd
Copy link
Member

WillAyd commented Jun 30, 2020

This breaks API pretty heavily so can't just go with it in current form; would have to go through a depreciation cycle first

This is somewhat related to #22639 though I don't think col_specs is much better than colspecs so I'd be -1 on doing this given churn

@WillAyd WillAyd added the IO Data IO issues that don't fit into a more specific label label Jun 30, 2020
@erfannariman
Copy link
Member Author

erfannariman commented Jun 30, 2020

This breaks API pretty heavily so can't just go with it in current form; would have to go through a depreciation cycle first

Sure, but I'm not familiar with it, is there any documentation on that which I can go through?

This is somewhat related to #22639 though I don't think col_specs is much better than colspecs so I'd be -1 on doing this given churn

In my opinion I think going with col_specs and col_widths would make more sense, purely for the consistency and the problem I mentioned in the issue, where using width instead of widths will not throw an error and the argument names are too similar. Plus using underscore for multi word variables is agreed upon in the issue you are referencing to right?

@WillAyd
Copy link
Member

WillAyd commented Jun 30, 2020

where using width instead of widths will not throw an error and the argument names are too similar.

That is unrelated to the naming convention. I think if you wanted to remove kwargs from this and replace with the appropriate name arguments that would make more sense, as there are probably only a few that should be passed from this to the TextFileReader

@erfannariman
Copy link
Member Author

where using width instead of widths will not throw an error and the argument names are too similar.

That is unrelated to the naming convention. I think if you wanted to remove kwargs from this and replace with the appropriate name arguments that would make more sense, as there are probably only a few that should be passed from this to the TextFileReader

That makes sense as well. Although I would not be sure how to decide which name arguments to include / exclude, would that be all the arguments which can be found in the tests?

@WillAyd
Copy link
Member

WillAyd commented Jun 30, 2020 via email

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah we cannot simply change these w/o a deprecation cycle, nor do i think the churn is worthile.

However as @WillAyd indicated, remove the ability to accept **kwargs would be ok

@jreback jreback added IO CSV read_csv, to_csv Error Reporting Incorrect or improved errors from pandas and removed IO CSV read_csv, to_csv labels Jul 2, 2020
@MarcoGorelli
Copy link
Member

Hi @erfannariman - is this still active?

@erfannariman
Copy link
Member Author

Yes, will pick this up after my vacation.

fangchenli and others added 16 commits September 1, 2020 12:36
…ce (#35899)

* REF: remove unnecesary try/except

* TST: add test for agg on ordered categorical cols (#35630)

* TST: resample does not yield empty groups (#10603) (#35799)

* revert accidental rebase

* REF: handle axis=None cases inside DataFrame.all/any

* annotate

* dummy commit to force Travis

Co-authored-by: Karthik Mathur <[email protected]>
Co-authored-by: tkmz-n <[email protected]>
* REF: remove unnecesary try/except

* TST: add test for agg on ordered categorical cols (#35630)

* TST: resample does not yield empty groups (#10603) (#35799)

* revert accidental rebase

* BUG: BlockSlider not clearing index._cache

* update whatsnew

Co-authored-by: Karthik Mathur <[email protected]>
Co-authored-by: tkmz-n <[email protected]>
…36045)

* REF: remove unnecesary try/except

* TST: add test for agg on ordered categorical cols (#35630)

* TST: resample does not yield empty groups (#10603) (#35799)

* revert accidental rebase

* BUG: NDFrame.replace wrong exception type, wrong return when size==0

* bool->bool_t

* whatsnew

Co-authored-by: Karthik Mathur <[email protected]>
Co-authored-by: tkmz-n <[email protected]>
…35852)

* remove \n from docstring

* fix issue 17038

* revert change

* revert change

* add dropna doc for factorize

* rephrase the doc

* flake8

* fixup

* use NaN

* add dropna in series.factorize

* black

* add test

* linting

* linting

* doct

* fix black

* fixup

* fix doctest

* add whatsnew

* linting

* fix test

* try one time

* hide dropna and use na_sentinel=None

* update whatsnew

* rename test function

* remove dropna from factorize

* update doc

* docstring

* update doc

* add comment

* code change on review

* update doc

* code change on review

* minor move in whatsnew

* add default example

* doc

* one more try

* explicit doc

* add space
pandas\plotting\_matplotlib\core.py:231: error: "MPLPlot" has no attribute "style"  [attr-defined]
pandas\plotting\_matplotlib\core.py:232: error: "MPLPlot" has no attribute "style"  [attr-defined]
pandas\plotting\_matplotlib\core.py:233: error: "MPLPlot" has no attribute "style"  [attr-defined]
pandas\plotting\_matplotlib\core.py:235: error: "MPLPlot" has no attribute "style"  [attr-defined]
pandas\plotting\_matplotlib\core.py:385: error: "MPLPlot" has no attribute "label"; maybe "ylabel" or "xlabel"?  [attr-defined]
pandas\plotting\_matplotlib\core.py:553: error: "MPLPlot" has no attribute "mark_right"  [attr-defined]
pandas\plotting\_matplotlib\core.py:732: error: "MPLPlot" has no attribute "style"  [attr-defined]
pandas\plotting\_matplotlib\core.py:733: error: "MPLPlot" has no attribute "style"  [attr-defined]
pandas\plotting\_matplotlib\core.py:735: error: "MPLPlot" has no attribute "style"  [attr-defined]
pandas\plotting\_matplotlib\core.py:738: error: "MPLPlot" has no attribute "style"  [attr-defined]
pandas\plotting\_matplotlib\core.py:739: error: "MPLPlot" has no attribute "style"  [attr-defined]
pandas\plotting\_matplotlib\core.py:741: error: "MPLPlot" has no attribute "style"  [attr-defined]
pandas\plotting\_matplotlib\core.py:1008: error: "ScatterPlot" has no attribute "label"  [attr-defined]
pandas\plotting\_matplotlib\core.py:1075: error: "LinePlot" has no attribute "stacked"  [attr-defined]
pandas\plotting\_matplotlib\core.py:1180: error: "LinePlot" has no attribute "stacked"  [attr-defined]
pandas\plotting\_matplotlib\core.py:1269: error: "AreaPlot" has no attribute "stacked"  [attr-defined]
pandas\plotting\_matplotlib\core.py:1351: error: "BarPlot" has no attribute "stacked"  [attr-defined]
pandas\plotting\_matplotlib\core.py:1427: error: "BarPlot" has no attribute "stacked"  [attr-defined]
@dsaxton
Copy link
Member

dsaxton commented Sep 19, 2020

@erfannariman Can you merge master to fix conflicts?

@erfannariman erfannariman deleted the distinguish_widths_argument branch September 21, 2020 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Error Reporting Incorrect or improved errors from pandas IO Data IO issues that don't fit into a more specific label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ENH: more distinguish name for widths arugment in read_fwf