Skip to content

DOCS: Update import statements in docstrings #21749

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
7 of 18 tasks
alphaCTzo7G opened this issue Jul 5, 2018 · 17 comments
Closed
7 of 18 tasks

DOCS: Update import statements in docstrings #21749

alphaCTzo7G opened this issue Jul 5, 2018 · 17 comments

Comments

@alphaCTzo7G
Copy link
Contributor

alphaCTzo7G commented Jul 5, 2018

xref #21731 (review)

  • ./pandas/plotting/_converter.py|134 col 17| ">>> from pandas.plotting import register_matplotlib_converters"
  • pandas/plotting/_misc.py|501 col 5| >>> from pandas import read_csv
  • pandas/plotting/_misc.py|502 col 5| >>> from pandas.tools.plotting import parallel_coordinates
  • ./pandas/util/testing.py|602 col 5| >>> from pandas.util.testing import capture_stdout DOC: updates documentations Closes #21749 #42979
  • ./pandas/util/testing.py|650 col 5| >>> from pandas.util.testing import capture_stderr DOC: updates documentations Closes #21749 #42979
  • ./pandas/util/testing.py|2213 col 7| >>> from pandas.util.testing import network DOC: updates documentations Closes #21749 #42979
  • ./pandas/util/testing.py|2214 col 7| >>> from pandas.io.common import urlopen DOC: updates documentations Closes #21749 #42979
  • ./pandas/tseries/holiday.py|145 col 9| >>> from pandas.tseries.holiday import Holiday, nearest_workday DOC: Update import statement #45485
  • ./pandas/tseries/holiday.py|146 col 9| >>> from pandas import DateOffset
  • ./pandas/core/sparse/series.py|739 col 9| >>> from numpy import nan
  • pandas/core/frame.py|2844 col 9| >>> from numpy.random import randn
  • pandas/core/frame.py|2845 col 9| >>> from pandas import DataFrame
  • ./pandas/core/algorithms.py|1519 col 5| >>> from pandas.api.extensions import take
  • ./pandas/core/dtypes/concat.py|285 col 5| >>> from pandas.api.types import union_categoricals Ko ya346/update import doc #45346
  • ./pandas/io/pytables.py|457 col 5| >>> from pandas import DataFrame
  • ./pandas/io/pytables.py|458 col 5| >>> from numpy.random import randn
  • ./pandas/io/json/normalize.py|138 col 5| >>> from pandas.io.json import json_normalize
  • pandas/io/stata.py|2713 col 5| >>> from pandas.io.stata import StataWriter117 Ko ya346/update import doc #45346
@TomAugspurger
Copy link
Contributor

What's this for?

@gfyoung gfyoung changed the title Creating issue to keep track of changes to be made in the documentation DOCS: Update import statements in docstrings Jul 5, 2018
@gfyoung gfyoung added the Docs label Jul 5, 2018
@alphaCTzo7G
Copy link
Contributor Author

This is related to this.. #21731 (comment)

@gfyoung
Copy link
Member

gfyoung commented Jul 5, 2018

@TomAugspurger : I've updated the issue to clarify the purpose.

@alphaCTzo7G
Copy link
Contributor Author

alphaCTzo7G commented Jul 6, 2018

I modified the import statements in the following files from the list in the OP and some others:

MODIFIED
    ./pandas/io/pytables.py|457 col 5| >>> from pandas import DataFrame
    ./pandas/io/pytables.py|458 col 5| >>> from numpy.random import randn
    ./pandas/core/sparse/series.py|739 col 9| >>> from numpy import nan
    ./pandas/tseries/holiday.py|146 col 9| >>> from pandas import DateOffset

but kept these intact..

./pandas/plotting/_converter.py|134 col 17| ">>> from pandas.plotting import register_matplotlib_converters"

    pandas/plotting/_misc.py|502 col 5| >>> from pandas.tools.plotting import parallel_coordinates
    ./pandas/util/testing.py|602 col 5| >>> from pandas.util.testing import capture_stdout
    ./pandas/util/testing.py|650 col 5| >>> from pandas.util.testing import capture_stderr
    ./pandas/util/testing.py|2213 col 7| >>> from pandas.util.testing import network
    ./pandas/util/testing.py|2214 col 7| >>> from pandas.io.common import urlopen
    ./pandas/tseries/holiday.py|145 col 9| >>> from pandas.tseries.holiday import Holiday, nearest_workday
    ./pandas/core/algorithms.py|1519 col 5| >>> from pandas.api.extensions import take
    ./pandas/core/dtypes/concat.py|285 col 5| >>> from pandas.api.types import union_categoricals
    ./pandas/io/json/normalize.py|138 col 5| >>> from pandas.io.json import json_normalize
    pandas/io/stata.py|2713 col 5| >>> from pandas.io.stata import StataWriter117

Do you think we should
change these as well to the form import pandas as pd; pd.... If we do, it wil
result in long function names as in module.class.function(args)

These were modified in a different PR

    pandas/core/frame.py|2844 col 9| >>> from numpy.random import randn
    pandas/core/frame.py|2845 col 9| >>> from pandas import Dataframe

@jreback jreback added this to the 0.24.0 milestone Jul 6, 2018
@jreback jreback modified the milestones: 0.24.0, Contributions Welcome Dec 2, 2018
@jbrockmendel
Copy link
Member

Do we have an idea which of these are still relevant?

@salomondush
Copy link
Contributor

Take

@salomondush
Copy link
Contributor

Hello, I was wondering if it's okay to take on this issue because I noticed that some statements still use the old form

@MarcoGorelli
Copy link
Member

reopening as I don't think the linked PR closes all the items

@MarcoGorelli MarcoGorelli reopened this Aug 17, 2021
@Varun270
Copy link
Contributor

Varun270 commented Sep 7, 2021

@salomondush Are you still working on this, as I wanted to work on this issue?

feefladder pushed a commit to feefladder/pandas that referenced this issue Sep 7, 2021
@salomondush
Copy link
Contributor

I worked on some parts of it, but you can take the remaining check points

@salomondush salomondush removed their assignment Sep 7, 2021
@Varun270
Copy link
Contributor

Varun270 commented Sep 8, 2021

@salomondush Thank you so much this is my first time contributing to a big project. I might need your guidance.

@Varun270
Copy link
Contributor

take

@Varun270
Copy link
Contributor

@salomondush Hey, Can you tell me how did you find the exact location of docstrings that require fix? I followed the file path but didn't found those import statements that require fixing.

@salomondush
Copy link
Contributor

Most of them have been fixed, but if you use VS code, you should be able to search specific lines of code throughout all files.

@Varun270 Varun270 removed their assignment Jan 12, 2022
@ko-ya346
Copy link
Contributor

I will modify the documents in
pandas/io/stata.py and pandas/core/dtypes/concat.py.

@mariana-LJ
Copy link
Contributor

I'm addressing the following import update in the PR above:

./pandas/core/algorithms.py|1519 col 5| >>> from pandas.api.extensions import take

That's the only outdated import statement I could find. Does this mean all others have been addressed? Thanks!

@mroeschke
Copy link
Member

Appears like #45841 closed the last of the above checklist.

Closing, but if there are other leftover, individual issues can be opened instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests