Commit feddb06
refactor code to work with pandas 2.0 (#660)
* Transform positional argument into keyword argument
From pandas 2.0 any only accepts keyworkd arguments
ref pandas-dev/pandas#44896
* Change how reciprocal is computed
I have not fully understood why this solve the problem, but splitting
the operation in 2 lines does not seem to work
* Catch warnings from pandas.to_datetime
Now pandas.to_datetime raises a warning when the column cannot be converted
* check_dtype=False in tests datetime features
Pandas dataframes created from python integers are created with int
column types `int64` but the operation tested returns `int32` which
caused issues
* Use droplevel before merging
Merging dfs with different column lelvels has been disallowed
ref pandas-dev/pandas#34862
* Change expected values for months
I am not sure why this caused an issue, maybe due to type casting?
* run black
* run black on tests
* isort _variable_type_checks.py
* Fix datetime_subtraction
---------
Co-authored-by: Claudio Salvatore Arcidiacono <[email protected]>1 parent e73772d commit feddb06
File tree
6 files changed
+34
-14
lines changed- feature_engine
- datetime
- imputation
- transformation
- variable_handling
- tests
- test_datetime
- test_time_series/test_forecasting
6 files changed
+34
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
321 | | - | |
| 321 | + | |
322 | 322 | | |
323 | 323 | | |
324 | 324 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
208 | | - | |
| 208 | + | |
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
100 | 99 | | |
101 | 100 | | |
102 | 101 | | |
| |||
152 | 151 | | |
153 | 152 | | |
154 | 153 | | |
155 | | - | |
156 | | - | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | 4 | | |
3 | 5 | | |
| |||
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
9 | | - | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
28 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
36 | | - | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| 186 | + | |
186 | 187 | | |
187 | 188 | | |
188 | 189 | | |
| |||
198 | 199 | | |
199 | 200 | | |
200 | 201 | | |
| 202 | + | |
201 | 203 | | |
202 | 204 | | |
203 | 205 | | |
| |||
215 | 217 | | |
216 | 218 | | |
217 | 219 | | |
| 220 | + | |
218 | 221 | | |
219 | 222 | | |
220 | 223 | | |
| |||
232 | 235 | | |
233 | 236 | | |
234 | 237 | | |
| 238 | + | |
235 | 239 | | |
236 | 240 | | |
237 | 241 | | |
| |||
251 | 255 | | |
252 | 256 | | |
253 | 257 | | |
| 258 | + | |
254 | 259 | | |
255 | 260 | | |
256 | 261 | | |
257 | 262 | | |
258 | 263 | | |
259 | | - | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
260 | 267 | | |
261 | 268 | | |
262 | 269 | | |
| |||
269 | 276 | | |
270 | 277 | | |
271 | 278 | | |
| 279 | + | |
272 | 280 | | |
273 | 281 | | |
274 | 282 | | |
| |||
281 | 289 | | |
282 | 290 | | |
283 | 291 | | |
| 292 | + | |
284 | 293 | | |
285 | 294 | | |
286 | 295 | | |
| |||
290 | 299 | | |
291 | 300 | | |
292 | 301 | | |
293 | | - | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
294 | 305 | | |
295 | 306 | | |
296 | 307 | | |
| |||
311 | 322 | | |
312 | 323 | | |
313 | 324 | | |
| 325 | + | |
314 | 326 | | |
315 | 327 | | |
316 | 328 | | |
| |||
356 | 368 | | |
357 | 369 | | |
358 | 370 | | |
359 | | - | |
| 371 | + | |
360 | 372 | | |
361 | 373 | | |
362 | 374 | | |
| |||
372 | 384 | | |
373 | 385 | | |
374 | 386 | | |
375 | | - | |
| 387 | + | |
376 | 388 | | |
377 | 389 | | |
378 | 390 | | |
| |||
399 | 411 | | |
400 | 412 | | |
401 | 413 | | |
| 414 | + | |
402 | 415 | | |
403 | 416 | | |
404 | 417 | | |
| |||
435 | 448 | | |
436 | 449 | | |
437 | 450 | | |
| 451 | + | |
438 | 452 | | |
439 | 453 | | |
440 | 454 | | |
| |||
443 | 457 | | |
444 | 458 | | |
445 | 459 | | |
| 460 | + | |
446 | 461 | | |
447 | 462 | | |
448 | 463 | | |
| |||
457 | 472 | | |
458 | 473 | | |
459 | 474 | | |
460 | | - | |
461 | | - | |
| 475 | + | |
462 | 476 | | |
463 | 477 | | |
464 | 478 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
380 | 380 | | |
381 | 381 | | |
382 | 382 | | |
| 383 | + | |
383 | 384 | | |
384 | 385 | | |
| 386 | + | |
385 | 387 | | |
386 | 388 | | |
387 | 389 | | |
| |||
404 | 406 | | |
405 | 407 | | |
406 | 408 | | |
| 409 | + | |
407 | 410 | | |
408 | 411 | | |
409 | 412 | | |
410 | 413 | | |
411 | 414 | | |
412 | 415 | | |
413 | 416 | | |
| 417 | + | |
414 | 418 | | |
415 | 419 | | |
416 | 420 | | |
| |||
0 commit comments