-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Fixed tuple to List Conversion in Dataframe class #25089
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
Changes from 4 commits
5ab27e5
acfe3e0
60cc4a6
37936a3
a852afb
26cb100
3e424ef
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,13 +22,14 @@ Fixed Regressions | |
|
||
- Fixed regression in :meth:`DataFrame.all` and :meth:`DataFrame.any` where ``bool_only=True`` was ignored (:issue:`25101`) | ||
|
||
- Fixed regression in :meth:`DataFrame.__init__` where mixed type of rows generated `Segmentation fault` (:issue:`25075`) | ||
|
||
.. _whatsnew_0242.enhancements: | ||
|
||
Enhancements | ||
^^^^^^^^^^^^ | ||
|
||
- | ||
- | ||
- The DataFrame class supports list as well as tuples in the ndarray, which previously raised `TypeError` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is not needed |
||
|
||
.. _whatsnew_0242.bug_fixes: | ||
|
||
|
@@ -37,9 +38,7 @@ Bug Fixes | |
|
||
**Conversion** | ||
|
||
- | ||
- | ||
- | ||
- Fixed bug in :meth:`lib.pyx` where `tuple` to `list` conversion failed (:issue:`25089`) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is not needed |
||
|
||
**Indexing** | ||
|
||
|
@@ -94,4 +93,4 @@ Bug Fixes | |
Contributors | ||
~~~~~~~~~~~~ | ||
|
||
.. contributors:: v0.24.1..v0.24.2 | ||
.. contributors:: v0.24.1..v0.24.2 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1183,6 +1183,13 @@ def test_constructor_mixed_dict_and_Series(self): | |
index=['a', 'b']) | ||
tm.assert_frame_equal(result, expected) | ||
|
||
def test_constructor_mixed_type_rows(self): | ||
data = [[1, 2], (3, 4)] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add the issue number as a comment |
||
result = DataFrame(data) | ||
data2 = [[1, 2], [3, 4]] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you can inline data2 to the constructor |
||
expected = DataFrame(data2) | ||
tm.assert_frame_equal(result, expected) | ||
|
||
def test_constructor_tuples(self): | ||
result = DataFrame({'A': [(1, 2), (3, 4)]}) | ||
expected = DataFrame({'A': Series([(1, 2), (3, 4)])}) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed issue in
DataFrame
construction with passing a mixed list of mixed types could segfault.