-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Add check for array lengths in from_arrays method (GH13599) #13633
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
Closed
sahildua2305
wants to merge
51
commits into
pandas-dev:master
from
sahildua2305:multi-from-arrays-fix
Closed
Changes from 3 commits
Commits
Show all changes
51 commits
Select commit
Hold shift + click to select a range
ff5ef13
BUG: Add check for array lengths in from_arrays method (GH13599)
sahildua2305 db98e32
BUG: Add test for array length mismatch
sahildua2305 5e7bd92
BUG: Fix minor issue with new test for from_arrays
sahildua2305 27d2915
CLN: Fix compile time warnings
yui-knk 06103dd
Pin IPython for doc build to 4.x (see #13639)
jorisvandenbossche 7dd4091
CLN: reorg type inference & introspection
jreback 20de266
BLD: included pandas.api.* in setup.py (#13640)
gfyoung 4a9e66e
Minor fix for linter
sahildua2305 94b829d
Update whatsnew entry
sahildua2305 44f3229
DOC/BLD: pin IPython version to 4.2.0 (#13639) (#13647)
jorisvandenbossche 6f0a020
TST: reorganize tools.tests (#13619)
sinhrks a711b42
BF(TST): allow AttributeError being raised (in addition to TypeError)…
yarikoptic 084ceae
API, DEPR: Raise and Deprecate Reshape for Pandas Objects
gfyoung 3f6d4bd
CLN: Fix compile time warnings
yui-knk c9a27ed
CLN: fix some issues in asv benchmark suite (#13630)
jorisvandenbossche 05b976c
TST: add tests for Timestamp.toordinal/fromordinal
sinhrks 71a0675
CLN: Initialization coincides with mapping, hence with uniqueness check
toobaz 0a70b5f
API: Change Period('NAT') to return NaT
sinhrks 1bee56e
BUG: construction of Series with integers on windows not default to i…
jreback d7c028d
CLN: Removed levels attribute from Categorical
gfyoung 91691de
Fix minor typo
sahildua2305 043879f
DOC: Add reference of DataFrame.rename_axis and Series.rename_axis to…
shawnheide 76d7e77
DOC: correct template for .cum* descriptions (#13683)
shawnheide ada6bf3
DOC: fix a keyword coerce in array_to_timedelta64 (#13686)
yui-knk 6b9cd15
TST: assert message shows unnecessary diff (#13676)
sinhrks 694fe61
ENH: Series.append now has ignore_index kw
sinhrks 5a52171
BUG: Add type check for width parameter in str.pad method GH13598
wcwagner 9f635cd
BUG: Cast a key to NaT before get loc from Index
yui-knk b054536
BUG: merge_asof not handling allow_exact_matches and tolerance on fir…
jreback 361a2b4
CLN: removed pandas.sandbox
gfyoung 1e1e9b3
DEPR: Remove legacy offsets
sinhrks 006bd0b
CLN: removed setter method of categorical's ordered attribute
gfyoung b225cac
BUG/PERF: Sort mixed-int in Py3, fix Index.difference
pijucha fafef5d
ENH: Add support for writing variable labels to Stata files
bashtage 506520b
API: Index doesn't results in PeriodIndex if Period contains NaT
sinhrks 31c2e5f
PERF: improve DTI string parse
sinhrks 4c9ae94
DOC: resample warnings
chris-b1 8acfad3
CLN: Removed the flavor='mysql' option and deprecate flavor in DataFr…
gfyoung 786edc7
ENH: add time-window capability to .rolling
jreback 57b373c
CLN: Remove a test case about Timestamp to TestTimestamp (#13722)
yui-knk b25a2a1
DOC/DEPR: pivot_annual
sinhrks 016b352
PERF: Improve Period hashing
sinhrks 4962131
MAINT: Removed some warnings in tests
gfyoung 634e95d
CLN: removed the 'diff' method for Index
gfyoung a2e1917
BUG: Add check for array lengths in from_arrays method (GH13599)
sahildua2305 e401cf1
BUG: Add test for array length mismatch
sahildua2305 93296ff
BUG: Fix minor issue with new test for from_arrays
sahildua2305 72fb52d
Minor fix for linter
sahildua2305 57d5250
Update whatsnew entry
sahildua2305 bb6a952
Fix minor typo
sahildua2305 6ff0ce1
Remove minor typo
sahildua2305 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
add a positive example (e.g. it doesn't raise)
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.
I am not sure if I can assert explicitly that the ValueError isn't raised.
Should I simply add an example where array lengths are same and assert the response is the MultiIndex object with valid data?
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.
you simply construct an expected MultiIndex and use
.equals
that it is equal to a result that uses.from_arrays
. I am sure there are other examples to model from.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.
@jreback is that test really required? The same input array length case is anyway getting checked in all other
from_arrays
related tests.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.
better yet make sure to check with a 0-len array (check for all 2 cases, idx1 or idx2 is 0-len)