BUG: Fix problems in group rank when both nans and infinity are present #20561
Please include the output of the validation script below between the "```" ticks:

```

################################################################################
############# Docstring (pandas._libs.groupby.group_rank_float64)  #############
################################################################################

Provides the rank of values within each group

Parameters
----------
out : array of float64_t values which this method will write its results to
values : array of float64_t values to be ranked
labels : array containing unique label for each group, with its ordering
    matching up to the corresponding record in `values`
is_datetimelike : bool
    unused in this method but provided for call compatibility with other
    Cython transformations
ties_method :  {'keep', 'top', 'bottom'}
    * keep: leave NA values where they are
    * top: smallest rank if ascending
    * bottom: smallest rank if descending
ascending : boolean
    False for ranks by high (1) to low (N)
pct : boolean
    Compute percentage rank of data within each group

Notes
-----
This method modifies the `out` parameter rather than returning an object

################################################################################
################################## Validation ##################################
################################################################################

Errors found:
        Docstring text (summary) should start in the line immediately after the opening quotes (not in the same line, or leaving a blank line in between)
        Summary does not end with dot
        No extended summary found
        Errors in parameters section
                Unknown parameters {'values', 'pct', 'labels', 'out', 'ties_method', 'ascending', 'is_datetimelike'}
                Parameter "out" has no description
                Parameter "values" has no description
                Parameter "labels" description should start with capital letter
                Parameter "labels" description should finish with "."
                Parameter "is_datetimelike" description should start with capital letter
                Parameter "is_datetimelike" description should finish with "."
                Parameter "ties_method" description should start with capital letter
                Parameter "ties_method" description should finish with "."
                Parameter "ascending" description should finish with "."
                Parameter "pct" description should finish with "."
        No returns section found
        See Also section not found
        No examples section found

```

Checklist for other PRs (remove this part if you are doing a PR for the pandas documentation sprint):

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