Skip to content
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

Enable DataFrame setting value as list of labels. (Resolves #894) #905

Merged
merged 8 commits into from
Oct 13, 2019

Conversation

itholic
Copy link
Contributor

@itholic itholic commented Oct 8, 2019

Resolves #894

for below DataFrame,

>>> df = ks.DataFrame([[1, 2], [4, 5], [7, 8]],
...                   index=['cobra', 'viper', 'sidewinder'],
...                   columns=['max_speed', 'shield'])
>>> df
            max_speed  shield
cobra               1       2
viper               4       5
sidewinder          7       8

now we can set value for all items matching the list of labels like Pandas.

>>> df.loc[['viper', 'sidewinder'], ['shield']] = 50
>>> df
            max_speed  shield
cobra               1       2
viper               4      50
sidewinder          7      50

@itholic itholic changed the title Enable DataFrame setting value as list of labels. Enable DataFrame setting value as list of labels. (Resolves #894) Oct 8, 2019
@codecov-io
Copy link

codecov-io commented Oct 8, 2019

Codecov Report

Merging #905 into master will increase coverage by 0.15%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #905      +/-   ##
==========================================
+ Coverage    94.3%   94.45%   +0.15%     
==========================================
  Files          34       34              
  Lines        6213     6369     +156     
==========================================
+ Hits         5859     6016     +157     
+ Misses        354      353       -1
Impacted Files Coverage Δ
databricks/koalas/indexing.py 94.4% <100%> (+1.88%) ⬆️
databricks/koalas/series.py 95.46% <0%> (-0.11%) ⬇️
databricks/koalas/missing/groupby.py 100% <0%> (ø) ⬆️
databricks/koalas/missing/frame.py 100% <0%> (ø) ⬆️
databricks/koalas/missing/series.py 100% <0%> (ø) ⬆️
databricks/koalas/frame.py 96.04% <0%> (+0.08%) ⬆️
databricks/koalas/__init__.py 85.36% <0%> (+0.36%) ⬆️
databricks/koalas/testing/utils.py 78.39% <0%> (+0.4%) ⬆️
databricks/koalas/internal.py 96.38% <0%> (+0.5%) ⬆️
databricks/koalas/namespace.py 86.83% <0%> (+0.51%) ⬆️
... and 1 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 9e38e54...4d35bb8. Read the comment docs.

databricks/koalas/indexing.py Outdated Show resolved Hide resolved
databricks/koalas/indexing.py Outdated Show resolved Hide resolved
databricks/koalas/indexing.py Show resolved Hide resolved
@HyukjinKwon
Copy link
Member

Seems okay to me except https://github.com/databricks/koalas/pull/905/files#r333446082

Copy link
Collaborator

@ueshin ueshin left a comment

Choose a reason for hiding this comment

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

Otherwise, LGTM.

databricks/koalas/indexing.py Outdated Show resolved Hide resolved
@softagram-bot
Copy link

Softagram Impact Report for pull/905 (head commit: 4d35bb8)

⭐ 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 8367c93 into databricks:master Oct 13, 2019
@itholic itholic deleted the frame_loc_setitem branch October 14, 2019 04:28
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.

Loc: Setting value for an entire row
5 participants