|
30 | 30 | )
|
31 | 31 | test_long3 = @pivot_longer(test_df, -(name:num))
|
32 | 32 | test_long4 = @pivot_longer(test_df, label)
|
| 33 | + |
| 34 | + true_long5 = DataFrame( |
| 35 | + name = ["A","B","A","B","A","B","A","B"], |
| 36 | + variable = ["label","label","label","label","num","num","num","num"], |
| 37 | + value = [1,1,2,2,1,2,3,4], |
| 38 | + ) |
| 39 | + test_long5 = @pivot_longer(test_df, [label,num]) |
| 40 | + |
| 41 | + true_long6 = DataFrame( |
| 42 | + label = [1,1,2,2], |
| 43 | + num = [1,2,3,4], |
| 44 | + variable = ["name","name","name","name"], |
| 45 | + value = ["A","B","A","B"], |
| 46 | + ) |
| 47 | + test_long6 = @pivot_longer(test_df, -[label,num]) |
| 48 | + |
33 | 49 | @test all(Array(true_long1 .== test_long1))
|
34 | 50 | @test all(Array(true_long1 .== test_long2))
|
35 | 51 | @test all(Array(true_long3 .== test_long3))
|
36 | 52 | @test all(Array(true_long3 .== test_long4))
|
| 53 | + @test all(Array(true_long5 .== test_long5)) |
| 54 | + @test all(Array(true_long6 .== test_long6)) |
37 | 55 | end
|
38 | 56 | end
|
0 commit comments