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

adding series.transpose #9835

Merged
merged 29 commits into from
Dec 7, 2021
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
f13178b
added series.dt.floor
mayankanand007 Dec 2, 2021
693a6e9
Merge branch 'rapidsai:branch-22.02' into branch-22.02
mayankanand007 Dec 2, 2021
789ace3
added datetimeindex.round
mayankanand007 Dec 2, 2021
7bf420a
Merge branch 'branch-22.02' of https://github.com/mayankanand007/cudf…
mayankanand007 Dec 2, 2021
96d22ba
move round impl. to IndexedFrame
mayankanand007 Dec 2, 2021
bdc25c9
added impl. for autocorr
mayankanand007 Dec 2, 2021
0adb13f
Merge branch 'rapidsai:branch-22.02' into feature_autocorr
mayankanand007 Dec 2, 2021
971366f
fixed bug
mayankanand007 Dec 2, 2021
c0dab10
Merge branch 'feature_autocorr' of https://github.com/mayankanand007/…
mayankanand007 Dec 2, 2021
710e30a
added to series.rst
mayankanand007 Dec 2, 2021
46bb589
code clean up
mayankanand007 Dec 3, 2021
142cd42
code clean up
mayankanand007 Dec 3, 2021
9bb435b
code clean up
mayankanand007 Dec 3, 2021
7fdfd18
code clcleaning
mayankanand007 Dec 3, 2021
dbbd88c
last cleanup
mayankanand007 Dec 3, 2021
1db7589
add test cases
mayankanand007 Dec 3, 2021
d92d50a
Merge branch 'rapidsai:branch-22.02' into feature_autocorr
mayankanand007 Dec 3, 2021
a20e7e8
added series.transpose
mayankanand007 Dec 3, 2021
6dcd742
fixed style issues
mayankanand007 Dec 3, 2021
ca9faed
added an alias T for transpose
mayankanand007 Dec 3, 2021
b000894
fixed issue with test
mayankanand007 Dec 3, 2021
996022b
Merge branch 'rapidsai:branch-22.02' into transpose
mayankanand007 Dec 6, 2021
1999e50
Apply suggestions from code review
mayankanand007 Dec 6, 2021
c38959e
updated property implementation
mayankanand007 Dec 6, 2021
2c7ef9f
Merge branch 'rapidsai:branch-22.02' into transpose
mayankanand007 Dec 6, 2021
ef8e7b6
style issues
mayankanand007 Dec 6, 2021
d15daad
add string in pytest
mayankanand007 Dec 6, 2021
cfbcbd0
Update python/cudf/cudf/tests/test_series.py
mayankanand007 Dec 6, 2021
2c35902
fixed style issue
mayankanand007 Dec 6, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/cudf/source/api_docs/series.rst
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ Reshaping, sorting
Series.scatter_by_map
Series.searchsorted
Series.repeat
Series.transpose

Combining / comparing / joining / merging / encoding
----------------------------------------------------
Expand Down
6 changes: 6 additions & 0 deletions python/cudf/cudf/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -2788,6 +2788,12 @@ def cov(self, other, min_periods=None):

return lhs._column.cov(rhs._column)

def transpose(self):
mayankanand007 marked this conversation as resolved.
Show resolved Hide resolved
"""Return the transpose, which is by definition self.
"""

return self

def corr(self, other, method="pearson", min_periods=None):
"""Calculates the sample correlation between two Series,
excluding missing values.
Expand Down
11 changes: 11 additions & 0 deletions python/cudf/cudf/tests/test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -1346,3 +1346,14 @@ def test_nullable_bool_dtype_series(data, bool_dtype):
gsr = cudf.Series(data, dtype=bool_dtype)

assert_eq(psr, gsr.to_pandas(nullable=True))


@pytest.mark.parametrize("cudf_series", [(cudf.Series([0, 1, 2, 3]))])
def test_series_transpose(cudf_series):
psr = cudf_series.to_pandas()

cudf_transposed = cudf_series.transpose()
pd_transposed = psr.transpose()

assert_eq(pd_transposed, cudf_transposed)
assert_eq(cudf_transposed, cudf_series)