Skip to content

Conversation

@itholic
Copy link
Contributor

@itholic itholic commented Nov 19, 2019

Resolves #1043

>>> kdf = ks.DataFrame({'a': [1, 2, 3, 2],
...                     'b': [4.0, 2.0, 3.0, 1.0],
...                     'c': [300, 200, 400, 200]})
>>> kdf
   a    b    c
0  1  4.0  300
1  2  2.0  200
2  3  3.0  400
3  2  1.0  200

>>> kdf.idxmax()
a    2
b    0
c    2
Name: 0, dtype: int64

For Multi-column Index

>>> kdf = ks.DataFrame({'a': [1, 2, 3, 2],
...                     'b': [4.0, 2.0, 3.0, 1.0],
...                     'c': [300, 200, 400, 200]})
>>> kdf.columns = pd.MultiIndex.from_tuples([('a', 'x'), ('b', 'y'), ('c', 'z')])
>>> kdf
   a    b    c
   x    y    z
0  1  4.0  300
1  2  2.0  200
2  3  3.0  400
3  2  1.0  200

>>> kdf.idxmax()
(a, x)    2
(b, y)    0
(c, z)    2
Name: 0, dtype: int64

@codecov-io
Copy link

codecov-io commented Nov 19, 2019

Codecov Report

Merging #1054 into master will decrease coverage by 0.06%.
The diff coverage is 96.87%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1054      +/-   ##
==========================================
- Coverage    95.2%   95.14%   -0.07%     
==========================================
  Files          34       35       +1     
  Lines        6889     7003     +114     
==========================================
+ Hits         6559     6663     +104     
- Misses        330      340      +10
Impacted Files Coverage Δ
databricks/koalas/missing/frame.py 100% <ø> (ø) ⬆️
databricks/koalas/frame.py 96.8% <96.87%> (+0.05%) ⬆️
databricks/koalas/utils.py 95.7% <0%> (-2.47%) ⬇️
databricks/koalas/__init__.py 85.1% <0%> (-2.13%) ⬇️
databricks/koalas/indexing.py 94.26% <0%> (-0.63%) ⬇️
databricks/koalas/internal.py 96.42% <0%> (ø) ⬆️
databricks/koalas/missing/indexes.py 100% <0%> (ø) ⬆️
databricks/koalas/missing/series.py 100% <0%> (ø) ⬆️
databricks/koalas/numpy_compat.py 90% <0%> (ø)
... and 7 more

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 8a7a640...38d827b. Read the comment docs.

@softagram-bot
Copy link

Softagram Impact Report for pull/1054 (head commit: 38d827b)

⚠️ Copy paste found

ℹ️ frame.py: Copy paste fragment on line 5715 shared with ../namespace.py:

              on: Union[str, List[str], Tuple[str, ...], List[Tuple[str, ...]]] = None,
              left_on: Union[str, List[str], Tuple[s...(truncated 273 chars)

ℹ️ frame.py: Copy paste fragment on line 1474 shared with ../series.py:


    def to_latex(self, buf=None, columns=None, col_space=None, header=True, index=True,
                 na_rep='NaN',...(truncated 256 chars)

ℹ️ frame.py: Copy paste fragment inside the same file on lines 7213, 7296:


        # TODO: there is a similar logic to transpose in, for instance,
        #  DataFrame.any, Series.quantile. Maybe ...(truncated 1065 chars)

ℹ️ frame.py: Copy paste fragment inside the same file on lines 4844, 4865:

            sdf = self._sdf.select(
                self._internal.index_scols +
                [self._internal.scol_for(idx...(truncated 466 chars)

ℹ️ frame.py: Copy paste fragment inside the same file on lines 503, 910, 1854, 2799, 2883, 6677:


            sdf = self._sdf.select(
                self._internal.index_scols + [c._scol for c in applied])
            internal = self....(truncated 430 chars)

Now that you are on the file, it would be easier to pay back some tech. debt.

⭐ Change Overview

Showing the changed files, dependency changes and the impact - click for full size
(Open in Softagram Desktop for full details)

📄 Full report

Impact Report explained. Give feedback on this report to [email protected]

@HyukjinKwon HyukjinKwon merged commit 63d42c3 into databricks:master Dec 10, 2019
@itholic itholic deleted the f_idxminmax branch December 10, 2019 15:19
@ueshin ueshin mentioned this pull request Jan 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DataFrame.idxmax

5 participants