Skip to content

Commit

Permalink
Add DataFrame.items (alias of iteritems)
Browse files Browse the repository at this point in the history
  • Loading branch information
HyukjinKwon committed Sep 17, 2019
1 parent e992200 commit d9aafec
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions databricks/koalas/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from functools import partial, reduce
import sys
from itertools import zip_longest
from typing import Any, Optional, List, Tuple, Union, Generic, TypeVar
from typing import Any, Optional, List, Tuple, Union, Generic, TypeVar, Iterable

import numpy as np
import pandas as pd
Expand Down Expand Up @@ -916,7 +916,7 @@ def corr(self, method='pearson'):
"""
return corr(self, method)

def iteritems(self):
def iteritems(self) -> Iterable:
"""
Iterator over (column name, Series) pairs.
Expand Down Expand Up @@ -958,6 +958,10 @@ def iteritems(self):
cols = list(self.columns)
return list((col_name, self[col_name]) for col_name in cols)

def items(self):
"""This is an alias of ``iteritems``."""
return self.iteritems()

def to_clipboard(self, excel=True, sep=None, **kwargs):
"""
Copy object to the system clipboard.
Expand Down
1 change: 0 additions & 1 deletion databricks/koalas/missing/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ class _MissingPandasLikeDataFrame(object):
info = unsupported_function('info')
insert = unsupported_function('insert')
interpolate = unsupported_function('interpolate')
items = unsupported_function('items')
iterrows = unsupported_function('iterrows')
itertuples = unsupported_function('itertuples')
keys = unsupported_function('keys')
Expand Down
1 change: 1 addition & 0 deletions docs/source/reference/frame.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ Indexing, iteration
DataFrame.head
DataFrame.loc
DataFrame.iloc
DataFrame.items
DataFrame.iteritems
DataFrame.get

Expand Down

0 comments on commit d9aafec

Please sign in to comment.