Skip to content

DOC: Upgraded Docstring pandas.DataFrame.dot #23024

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

Merged
merged 6 commits into from
Dec 19, 2018

Conversation

HubertKl
Copy link
Contributor

@HubertKl HubertKl commented Oct 7, 2018

  • closes #xxxx
  • tests added / passed
  • [x ] passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

@pep8speaks
Copy link

Hello @HubertKl! Thanks for submitting the PR.

@codecov
Copy link

codecov bot commented Oct 7, 2018

Codecov Report

Merging #23024 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #23024   +/-   ##
=======================================
  Coverage    92.2%    92.2%           
=======================================
  Files         162      162           
  Lines       51700    51700           
=======================================
  Hits        47671    47671           
  Misses       4029     4029
Flag Coverage Δ
#multiple 90.6% <ø> (ø) ⬆️
#single 43.02% <ø> (ø) ⬆️
Impacted Files Coverage Δ
pandas/core/frame.py 96.91% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 67faf6c...89e2be4. Read the comment docs.

@jreback jreback added Docs Numeric Operations Arithmetic, Comparison, and Logical operations labels Oct 7, 2018
Copy link
Member

@datapythonista datapythonista left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution @HubertKl, and sorry this got lost and wasn't reviewed until now.

Added few comments.

Return the Series of the matrix product between the Dataframe and
other if other is a Series, the Dataframe of the matrix product of
each columns of the DataFrame/np.array and each columns of other
if other is a DataFrame or a numpy.ndarray.
Copy link
Member

Choose a reason for hiding this comment

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

Can you rephrase this? Can't really understand it, we probably need to have more than one sentence.

See Also
--------
Series.dot: Compute the inner product of a Series with another Series
or the columns of a DataFrame or the columns of a numpy array.
Copy link
Member

Choose a reason for hiding this comment

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

Can you say instead "Same method for Series." or similar if that makes sense.

Copy link
Member

Choose a reason for hiding this comment

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

do you mind changing this?

Examples
--------
>>> df = pd.DataFrame([[0, 1, -2, 3], [4, -5, 6, 7]])
>>> s = pd.Series([0, 1, 2, 3])
Copy link
Member

Choose a reason for hiding this comment

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

Can you try to use smaller / easier values, so the math can be done mentally?

Also, avoid the print functions, the value will be shown without them too.

And divide the examples in groups with a blank line between them, and probably a short explanation of what you're doing would help reading.

@datapythonista
Copy link
Member

@HubertKl do you have time to address the review comments and fix the conflicts?

@HubertKl
Copy link
Contributor Author

HubertKl commented Dec 2, 2018

I tried to address the issues. Sorry for the delay but I didn't figure that the review would append only now.

Copy link
Member

@datapythonista datapythonista left a comment

Choose a reason for hiding this comment

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

looks great, just two minor things, and it's ready

This method computes the matrix product between the DataFrame and the
values of an other Series, DataFrame or a numpy array.

It can also be called using `self @ other` in Python >= 3.5.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
It can also be called using `self @ other` in Python >= 3.5.
It can also be called using ``self @ other`` in Python >= 3.5.

sorry I didn't see that before, for code we use double backticks (single backticks are for things we reference, like a function name, a class, a variable...)

See Also
--------
Series.dot: Compute the inner product of a Series with another Series
or the columns of a DataFrame or the columns of a numpy array.
Copy link
Member

Choose a reason for hiding this comment

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

do you mind changing this?

@HubertKl
Copy link
Contributor Author

HubertKl commented Dec 4, 2018

It is done.

Copy link
Member

@datapythonista datapythonista left a comment

Choose a reason for hiding this comment

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

lgtm, thanks @HubertKl

if you can merge master and update the PR branch, to rerun the CI and leave it green

@datapythonista
Copy link
Member

@HubertKl do you have time to merge master into your branch, so we can merge?

@datapythonista datapythonista self-assigned this Dec 7, 2018
@datapythonista
Copy link
Member

@jreback this should be ready to be merged

@jreback jreback added this to the 0.24.0 milestone Dec 19, 2018
@jreback jreback merged commit 0a29896 into pandas-dev:master Dec 19, 2018
@jreback
Copy link
Contributor

jreback commented Dec 19, 2018

thanks @HubertKl

TomAugspurger pushed a commit to TomAugspurger/pandas that referenced this pull request Dec 20, 2018
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs Numeric Operations Arithmetic, Comparison, and Logical operations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants