This repository was archived by the owner on Dec 22, 2019. It is now read-only.
Commit 72056a2
araraonline
Modify behavior on duplicates
When there were duplicates on the columns index, sort was allowed and
duplicates were allowed if the indexes had the same values (as found by
idx.tolist()).
Now, considering that pandas doesn't allow to sort the index when there
are duplicate values (DataFrame.reindex fails) and that searching for
the same values is counter-productive and prone to fail, depending on
the different types of indexes, the behavior was modified to this:
- When sort=True and there are duplicates in at least one index, an
error is raised and append stops.
- Dframes with duplicate indexes are only considered to be joined when
the indexes share the same identity (that is, they are the same object
comparable with `idx1 is idx2`)
Some other improvements to the code have also been made and I believe it
is better in a general mode.1 parent 87cc878 commit 72056a2
File tree
4 files changed
+204
-81
lines changed- pandas
- core
- indexes
- tests/reshape
4 files changed
+204
-81
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6420 | 6420 | | |
6421 | 6421 | | |
6422 | 6422 | | |
6423 | | - | |
6424 | | - | |
6425 | | - | |
6426 | | - | |
| 6423 | + | |
6427 | 6424 | | |
6428 | 6425 | | |
6429 | | - | |
6430 | | - | |
6431 | | - | |
6432 | | - | |
6433 | | - | |
6434 | | - | |
6435 | | - | |
6436 | | - | |
6437 | | - | |
6438 | | - | |
6439 | | - | |
6440 | | - | |
| 6426 | + | |
| 6427 | + | |
| 6428 | + | |
| 6429 | + | |
6441 | 6430 | | |
6442 | | - | |
6443 | | - | |
6444 | | - | |
6445 | | - | |
6446 | | - | |
6447 | | - | |
| 6431 | + | |
6448 | 6432 | | |
6449 | 6433 | | |
6450 | 6434 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
| 15 | + | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
| |||
38 | 37 | | |
39 | 38 | | |
40 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
41 | 52 | | |
42 | 53 | | |
43 | 54 | | |
| |||
181 | 192 | | |
182 | 193 | | |
183 | 194 | | |
184 | | - | |
| 195 | + | |
| 196 | + | |
185 | 197 | | |
186 | | - | |
| 198 | + | |
187 | 199 | | |
188 | 200 | | |
189 | 201 | | |
190 | 202 | | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
195 | 208 | | |
196 | 209 | | |
197 | | - | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
198 | 229 | | |
199 | 230 | | |
200 | 231 | | |
| |||
217 | 248 | | |
218 | 249 | | |
219 | 250 | | |
220 | | - | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
221 | 255 | | |
222 | 256 | | |
223 | 257 | | |
224 | 258 | | |
225 | 259 | | |
226 | | - | |
227 | | - | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
228 | 265 | | |
229 | 266 | | |
230 | 267 | | |
231 | 268 | | |
232 | 269 | | |
233 | 270 | | |
234 | | - | |
| 271 | + | |
235 | 272 | | |
236 | | - | |
237 | | - | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
238 | 280 | | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
245 | 306 | | |
246 | 307 | | |
| 308 | + | |
247 | 309 | | |
248 | 310 | | |
249 | 311 | | |
| |||
278 | 340 | | |
279 | 341 | | |
280 | 342 | | |
281 | | - | |
| 343 | + | |
282 | 344 | | |
283 | 345 | | |
284 | 346 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | 161 | | |
166 | 162 | | |
167 | 163 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
42 | 72 | | |
43 | 73 | | |
44 | 74 | | |
| |||
403 | 433 | | |
404 | 434 | | |
405 | 435 | | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | | - | |
435 | | - | |
436 | | - | |
437 | | - | |
438 | | - | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
439 | 520 | | |
440 | 521 | | |
441 | 522 | | |
| |||
0 commit comments