Convert data rows in column wise insql - mysql

I have multiple number of rows. I want to change into column wise.
My data
PondCrop DOC ABW TargetABW
01PA01-18 7 0 0.21
01PA01-18 15 0.59 0.77
01PA01-18 22 1.24 1.5
01PA01-18 28 0.92 2.6
01PA01-18 35 1.82 3.7
01PA01-18 42 2.6 4.8
01PA01-18 49 3.62 5.9
01PA01-18 56 4.64 7
01PA01-18 63 5.54 8.1
01PA01-18 66 6.24 8.1
01PA01-18 73 7.25 9.2
01PA02-18 7 0 0.21
01PA02-18 15 0.59 0.77
01PA02-18 22 1.24 1.5
01PA02-18 28 0.87 2.6
01PA02-18 35 1.8 3.7
01PA02-18 42 2.4 4.8
01PA02-18 49 3.51 5.9
01PA02-18 56 4.6 7
01PA02-18 63 5.51 8.1
01PA02-18 66 6.53 8.1
01PA02-18 73 7.42 9.2
01PA03-18 14 0.53 0.77
01PA03-18 21 1.14 1.5
01PA03-18 27 0.91 1.5
01PA03-18 34 1.67 2.6
01PA03-18 41 2.2 3.7
01PA03-18 48 3.24 4.8
01PA03-18 55 4.31 5.9
01PA03-18 62 4.94 7
01PA03-18 65 5.44 8.1
01PA03-18 72 6.41 9.2
01PA04-18 14 0.53 0.77
01PA04-18 21 1.14 1.5
01PA04-18 27 0.9 1.5
01PA04-18 34 1.52 2.6
01PA04-18 41 1.9 3.7
01PA04-18 48 2.6 4.8
01PA04-18 55 3.52 5.9
01PA04-18 62 4.21 7
01PA04-18 65 4.82 8.1
01PA04-18 72 5.87 9.2
01PA05-18 14 0.53 0.77
01PA05-18 21 1.14 1.5
01PA05-18 27 0.92 1.5
01PA05-18 34 1.49 2.6
01PA05-18 41 1.91 3.7
01PA05-18 48 2.64 4.8
01PA05-18 55 3.69 5.9
01PA05-18 62 4.19 7
01PA05-18 65 4.72 8.1
01PA05-18 72 5.74 9.2
01PA06-18 13 0.48 0.21
01PA06-18 20 1.04 0.77
01PA06-18 26 0.74 1.5
01PA06-18 33 1.25 2.6
01PA06-18 40 1.82 3.7
01PA06-18 47 3.12 4.8
01PA06-18 54 4.4 5.9
01PA06-18 61 5.44 7
01PA06-18 64 6.46 8.1
01PA06-18 71 7.3 9.2
01PA07-18 13 0.48 0.21
01PA07-18 20 1.04 0.77
01PA07-18 26 0.72 1.5
01PA07-18 33 1.32 2.6
01PA07-18 40 1.84 3.7
01PA07-18 47 3.05 4.8
01PA07-18 54 4.12 5.9
01PA07-18 61 5.21 7
01PA07-18 64 6 8.1
01PA07-18 71 6.9 9.2
01PA08-18 13 0.48 0.21
01PA08-18 20 1.04 0.77
01PA08-18 26 0.7 1.5
01PA08-18 33 1.3 2.6
01PA08-18 40 1.8 3.7
01PA08-18 47 3.07 4.8
01PA08-18 54 3.72 5.9
01PA08-18 61 4.52 7
01PA08-18 64 5.11 8.1
01PA08-18 71 5.87 9.2
01PA09-18 13 0.48 0.21
01PA09-18 20 1.04 0.77
01PA09-18 26 0.71 1.5
01PA09-18 33 1.22 2.6
01PA09-18 40 1.85 3.7
01PA09-18 47 2.9 4.8
01PA09-18 54 3.74 5.9
01PA09-18 61 4.4 7
01PA09-18 64 4.92 8.1
01PA09-18 71 5.78 9.2
01PB01-19 8 0 0.21
01PB01-19 15 0 0.77
01PB01-19 23 0.94 1.5
01PB01-19 30 1.85 2.6
01PB01-19 36 2.5 3.7
01PB01-19 43 3.1 4.8
01PB01-19 50 3.74 5.9
01PB01-19 57 5.05 7
01PB01-19 64 6.18 8.1
01PB01-19 71 7.03 9.2
01PB01-19 74 7.87 9.2
01PB01-19 81 8.41 10.3
01PB02-19 8 0 0.21
01PB02-19 15 0 0.77
01PB02-19 23 0.98 1.5
01PB02-19 30 1.82 2.6
01PB02-19 36 2.6 3.7
01PB02-19 43 3.4 4.8
01PB02-19 50 4 5.9
01PB02-19 57 5.5 7
01PB02-19 64 6.72 8.1
01PB02-19 71 7.5 9.2
01PB02-19 74 8.43 9.2
01PB02-19 81 9.6 10.3
01PB03-19 8 0 0.21
01PB03-19 15 0 0.77
01PB03-19 23 0.92 1.5
01PB03-19 30 1.88 2.6
01PB03-19 36 2.51 3.7
01PB03-19 43 3 4.8
01PB03-19 50 3.4 5.9
01PB03-19 57 5.03 7
01PB03-19 64 6.27 8.1
01PB03-19 71 7.32 9.2
01PB03-19 74 8.2 9.2
01PB03-19 81 9.6 10.3
01PB04-19 13 0 0.21
01PB04-19 21 1.14 1.5
01PB04-19 28 0.93 2.6
01PB04-19 34 1.3 2.6
01PB04-19 41 2.1 3.7
01PB04-19 48 2.9 4.8
01PB04-19 55 3.7 5.9
01PB04-19 62 4.49 7
01PB04-19 69 5.3 8.1
01PB04-19 72 6.08 9.2
01PB04-19 79 7.55 10.3
01PB05-19 13 0 0.21
01PB05-19 21 1.14 1.5
01PB05-19 28 0.83 2.6
01PB05-19 34 1.41 2.6
01PB05-19 41 1.9 3.7
01PB05-19 48 2.6 4.8
01PB05-19 55 3.37 5.9
01PB05-19 62 4.32 7
01PB05-19 69 5.03 8.1
01PB05-19 72 5.84 9.2
01PB05-19 79 6.9 10.3
01PB06-19 13 0 0.21
01PB06-19 21 1.14 1.5
01PB06-19 28 0.86 2.6
01PB06-19 34 1.4 2.6
01PB06-19 41 2.2 3.7
01PB06-19 48 2.9 4.8
01PB06-19 55 3.5 5.9
01PB06-19 62 4.61 7
01PB06-19 69 5.3 8.1
01PB06-19 72 6.18 9.2
01PB06-19 79 7.06 10.3
01PB07-19 12 0 0.21
01PB07-19 20 1.04 0.77
01PB07-19 27 0.85 1.5
01PB07-19 33 1.06 2.6
01PB07-19 40 1.96 3.7
01PB07-19 47 2.6 4.8
01PB07-19 54 3.45 5.9
01PB07-19 61 4.23 7
01PB07-19 68 5.04 8.1
01PB07-19 71 5.85 9.2
01PB07-19 78 6.7 10.3
01PB08-19 12 0 0.21
01PB08-19 20 1.04 0.77
01PB08-19 27 0.85 1.5
01PB08-19 33 1.2 2.6
01PB08-19 40 1.9 3.7
01PB08-19 47 2.7 4.8
01PB08-19 54 3.62 5.9
01PB08-19 61 4.49 7
01PB08-19 68 5.13 8.1
01PB08-19 71 6 9.2
01PB08-19 78 6.9 10.3
01PB09-19 12 0 0.21
01PB09-19 20 1.04 0.77
01PB09-19 27 0.78 1.5
01PB09-19 33 1.4 2.6
01PB09-19 40 2 3.7
01PB09-19 47 2.7 4.8
01PB09-19 54 3.86 5.9
01PB09-19 61 5.47 7
01PB09-19 68 6.03 8.1
01PB09-19 71 6.9 9.2
01PB09-19 78 7.5 10.3
01PC01-19 8 0 0.21
01PC01-19 15 0 0.77
01PC01-19 23 1.34 1.5
01PC01-19 30 1.77 2.6
01PC01-19 36 2.1 3.7
01PC01-19 43 3.2 4.8
01PC01-19 50 3.7 5.9
01PC01-19 57 4.6 7
01PC01-19 64 5.5 8.1
01PC01-19 71 6 9.2
01PC01-19 74 7 9.2
01PC01-19 81 7.4 10.3
01PC02-19 7 0 0.21
01PC02-19 14 0 0.77
01PC02-19 22 1.24 1.5
01PC02-19 29 1.56 2.6
01PC02-19 35 2.4 3.7
01PC02-19 42 3.1 4.8
01PC02-19 49 3.5 5.9
01PC02-19 56 4.34 7
01PC02-19 63 5.3 8.1
01PC02-19 70 6.2 9.2
01PC02-19 73 7 9.2
01PC02-19 80 7.85 10.3
01PC03-19 7 0 0.21
01PC03-19 14 0 0.77
01PC03-19 22 1.24 1.5
01PC03-19 29 1.62 2.6
01PC03-19 35 2.2 3.7
01PC03-19 42 2.6 4.8
01PC03-19 49 3.1 5.9
01PC03-19 56 4.1 7
01PC03-19 63 5 8.1
01PC03-19 70 5.9 9.2
01PC03-19 73 6.5 9.2
01PC03-19 80 7.6 10.3
01PC04-20 13 0 0.21
01PC04-20 21 1.14 1.5
01PC04-20 28 0.81 2.6
01PC04-20 34 1.5 2.6
01PC04-20 41 2.2 3.7
01PC04-20 48 2.9 4.8
01PC04-20 55 3.4 5.9
01PC04-20 62 4.5 7
01PC04-20 69 5 8.1
01PC04-20 72 6 9.2
01PC04-20 79 6.9 10.3
01PC05-19 13 0 0.21
01PC05-19 21 1.14 1.5
01PC05-19 28 0.88 2.6
01PC05-19 34 1.22 2.6
01PC05-19 41 2 3.7
01PC05-19 48 2.54 4.8
01PC05-19 55 3.1 5.9
01PC05-19 62 4.2 7
01PC05-19 69 4.6 8.1
01PC05-19 72 5.5 9.2
01PC05-19 79 6.2 10.3
01PC06-19 11 0 0.21
01PC06-19 19 0.94 0.77
01PC06-19 26 0.85 1.5
01PC06-19 32 1.05 2.6
01PC06-19 39 2.3 3.7
01PC06-19 46 2.9 4.8
01PC06-19 53 3.8 5.9
01PC06-19 60 4.3 7
01PC06-19 67 5 8.1
01PC06-19 70 5.8 9.2
01PC06-19 77 6.8 10.3
01PC07-19 11 0 0.21
01PC07-19 19 0.94 0.77
01PC07-19 26 0.79 1.5
01PC07-19 32 1.4 2.6
01PC07-19 39 1.98 3.7
01PC07-19 46 2.7 4.8
01PC07-19 53 3 5.9
01PC07-19 60 3.9 7
01PC07-19 67 5 8.1
01PC07-19 70 5.6 9.2
01PC07-19 77 6.14 10.3
01PC08-19 11 0 0.21
01PC08-19 19 0.94 0.77
01PC08-19 26 0.9 1.5
01PC08-19 32 1.2 2.6
01PC08-19 39 2 3.7
01PC08-19 46 2.5 4.8
01PC08-19 53 3 5.9
01PC08-19 60 4.1 7
01PC08-19 67 4.91 8.1
01PC08-19 70 5.5 9.2
01PC08-19 77 6 10.3
01PC09-20 11 0 0.21
01PC09-20 19 0.94 0.77
01PC09-20 26 0.8 1.5
01PC09-20 32 1.2 2.6
01PC09-20 39 1.95 3.7
01PC09-20 46 2.65 4.8
01PC09-20 53 3 5.9
01PC09-20 60 4.18 7
01PC09-20 67 5 8.1
01PC09-20 70 5.8 9.2
01PC09-20 77 6.4 10.3
01PD01-09 10 0 0.21
01PD01-09 18 0.84 0.77
01PD01-09 25 0.78 1.5
01PD01-09 31 1.02 2.6
01PD01-09 38 1.92 3.7
01PD01-09 45 2.52 4.8
01PD01-09 52 3.4 5.9
01PD01-09 59 4.11 7
01PD01-09 66 5.03 8.1
01PD01-09 69 5.7 8.1
01PD01-09 76 6.7 9.2
01PD02-09 10 0 0.21
01PD02-09 18 0.84 0.77
01PD02-09 25 0.8 1.5
01PD02-09 31 1.03 2.6
01PD02-09 38 1.88 3.7
01PD02-09 45 2.47 4.8
01PD02-09 52 3.33 5.9
01PD02-09 59 4.04 7
01PD02-09 66 4.85 8.1
01PD02-09 69 5.6 8.1
01PD02-09 76 6.45 9.2
01PD03-09 10 0 0.21
01PD03-09 18 0.84 0.77
01PD03-09 25 0.81 1.5
01PD03-09 31 0.99 2.6
01PD03-09 38 1.8 3.7
01PD03-09 45 2.45 4.8
01PD03-09 52 3.14 5.9
01PD03-09 59 4.01 7
01PD03-09 66 4.91 8.1
01PD03-09 69 5.5 8.1
01PD03-09 76 6.5 9.2
01PD04-09 8 0 0.21
01PD04-09 16 0.64 0.77
01PD04-09 23 0.67 1.5
01PD04-09 29 0.96 2.6
01PD04-09 36 1.9 3.7
01PD04-09 43 2.53 4.8
01PD04-09 50 3.26 5.9
01PD04-09 57 4.38 7
01PD04-09 64 5.42 8.1
01PD04-09 67 6.03 8.1
01PD04-09 74 6.6 9.2
01PD05-09 8 0 0.21
01PD05-09 16 0.64 0.77
01PD05-09 23 0.7 1.5
01PD05-09 29 1.02 2.6
01PD05-09 36 2.07 3.7
01PD05-09 43 2.72 4.8
01PD05-09 50 3.6 5.9
01PD05-09 57 4.56 7
01PD05-09 64 5.52 8.1
01PD05-09 67 6.2 8.1
01PD05-09 74 6.9 9.2
01PD08-09 8 0 0.21
01PD08-09 16 0.64 0.77
01PD08-09 23 0.86 1.5
01PD08-09 29 1.34 2.6
01PD08-09 36 2.23 3.7
01PD08-09 43 2.77 4.8
01PD08-09 50 3.79 5.9
01PD08-09 57 4.59 7
01PD08-09 64 5.62 8.1
01PD08-09 67 5.97 8.1
01PD08-09 74 7 9.2
01PD09-09 8 0 0.21
01PD09-09 16 0.64 0.77
01PD09-09 23 0.82 1.5
01PD09-09 29 1.34 2.6
01PD09-09 36 2.35 3.7
01PD09-09 43 2.79 4.8
01PD09-09 50 3.82 5.9
01PD09-09 57 4.64 7
01PD09-09 64 5.65 8.1
01PD09-09 67 6.04 8.1
01PD09-09 74 7.04 9.2
01PD10-10 14 0.53 0.77
01PD10-10 21 1.14 1.5
01PD10-10 27 0.89 1.5
01PD10-10 34 1.69 2.6
01PD10-10 41 2.31 3.7
01PD10-10 48 3.14 4.8
01PD10-10 55 4.2 5.9
01PD10-10 62 5.22 7
01PD10-10 65 5.82 8.1
01PD10-10 72 6.84 9.2
03PA01-17 11 0.37 0.21
03PA01-17 18 0.84 0.77
03PA01-17 24 0.75 1.5
03PA01-17 31 1.65 2.6
03PA01-17 38 2.5 3.7
03PA01-17 45 3.45 4.8
03PA01-17 52 4.1 5.9
03PA01-17 59 4.56 7
03PA01-17 62 4.8 7
03PA01-17 69 5.6 8.1
03PA02-17 11 0.37 0.21
03PA02-17 18 0.84 0.77
03PA02-17 24 0.55 1.5
03PA02-17 31 1.5 2.6
03PA02-17 38 2.3 3.7
03PA02-17 45 3.3 4.8
03PA02-17 52 4.4 5.9
03PA02-17 59 5.06 7
03PA02-17 62 5.5 7
03PA02-17 69 6.4 8.1
03PA03-17 11 0.37 0.21
03PA03-17 18 0.84 0.77
03PA03-17 24 0.65 1.5
03PA03-17 31 1.7 2.6
03PA03-17 38 2.16 3.7
03PA03-17 45 3.1 4.8
03PA03-17 52 4.3 5.9
03PA03-17 59 6.14 7
03PA03-17 62 6.5 7
03PA03-17 69 7.3 8.1
03PA04-16 11 0.37 0.21
03PA04-16 18 0.84 0.77
03PA04-16 24 0.45 1.5
03PA04-16 31 1.4 2.6
03PA04-16 38 2.1 3.7
03PA04-16 45 2.95 4.8
03PA04-16 52 4 5.9
03PA04-16 59 4.23 7
03PA04-16 62 4.7 7
03PA04-16 69 5.6 8.1
03PA05-16 9 0.26 0.21
03PA05-16 16 0.64 0.77
03PA05-16 22 1.34 1.5
03PA05-16 29 1.35 2.6
03PA05-16 36 2.2 3.7
03PA05-16 43 3.15 4.8
03PA05-16 50 3.9 5.9
03PA05-16 57 4.46 7
03PA05-16 60 4.8 7
03PA05-16 67 5.8 8.1
03PA06-16 7 0.19 0.21
03PA06-16 14 0.53 0.77
03PA06-16 20 1.14 0.77
03PA06-16 27 0.65 1.5
03PA06-16 34 1.4 2.6
03PA06-16 41 2.6 3.7
03PA06-16 48 3.7 4.8
03PA06-16 55 4.44 5.9
03PA06-16 58 4.85 7
03PA06-16 65 6 8.1
03PA07-16 8 0.22 0.21
03PA07-16 14 0.59 0.77
03PA07-16 21 0.55 1.5
03PA07-16 28 1.25 2.6
03PA07-16 35 2.4 3.7
03PA07-16 42 3.5 4.8
03PA07-16 49 4.18 5.9
03PA07-16 52 4.55 5.9
03PA07-16 59 5.7 7
03PA08-17 8 0.22 0.21
03PA08-17 14 0.59 0.77
03PA08-17 21 0.68 1.5
03PA08-17 28 1.5 2.6
03PA08-17 35 2.65 3.7
03PA08-17 42 3.9 4.8
03PA08-17 49 5.3 5.9
03PA08-17 52 5.8 5.9
03PA08-17 59 7.6 7
03PB02-16 7 0.19 0.21
03PB02-16 14 0.53 0.77
03PB02-16 20 1.14 0.77
03PB02-16 27 0.7 1.5
03PB02-16 34 1.6 2.6
03PB02-16 41 2.6 3.7
03PB02-16 48 3 4.8
03PB02-16 55 4.22 5.9
03PB02-16 58 4.65 7
03PB02-16 65 5.8 8.1
03PB05-16 13 0.48 0.21
03PB05-16 19 1.04 0.77
03PB05-16 26 0.9 1.5
03PB05-16 33 1.5 2.6
03PB05-16 40 2.5 3.7
03PB05-16 47 3.1 4.8
03PB05-16 54 3.78 5.9
03PB05-16 57 4.45 7
03PB05-16 64 5.6 8.1
03PB06-16 13 0.48 0.21
03PB06-16 19 1.04 0.77
03PB06-16 26 0.9 1.5
03PB06-16 33 1.7 2.6
03PB06-16 40 2.5 3.7
03PB06-16 47 3 4.8
03PB06-16 54 3.47 5.9
03PB06-16 57 4.1 7
03PB06-16 64 5 8.1
03PB07-16 13 0.48 0.21
03PB07-16 19 1.04 0.77
03PB07-16 26 0.7 1.5
03PB07-16 33 1.6 2.6
03PB07-16 40 2.4 3.7
03PB07-16 47 3 4.8
03PB07-16 54 3.5 5.9
03PB07-16 57 4 7
03PB07-16 64 4.8 8.1
03PB08-15 12 0.42 0.21
03PB08-15 18 0.94 0.77
03PB08-15 25 0.9 1.5
03PB08-15 32 1.5 2.6
03PB08-15 39 2.6 3.7
03PB08-15 46 3.1 4.8
03PB08-15 53 5.66 5.9
03PB08-15 56 6.1 7
03PB08-15 63 7 8.1
03PC01-16 7 0.22 0.21
03PC01-16 10 0.37 0.21
03PC01-16 17 0.84 0.77
03PC02-16 12 0.42 0.21
03PC02-16 18 0.94 0.77
03PC02-16 25 1.01 1.5
03PC02-16 32 1.73 2.6
03PC02-16 39 2.59 3.7
03PC02-16 46 3.25 4.8
03PC02-16 53 3.82 5.9
03PC02-16 56 4.15 7
03PC02-16 63 5.33 8.1
03PC03-16 9 0.26 0.21
03PC03-16 15 0.64 0.77
03PC03-16 22 1.01 1.5
03PC03-16 29 1.84 2.6
03PC03-16 36 2.31 3.7
03PC03-16 43 3.32 4.8
03PC03-16 50 4.77 5.9
03PC03-16 53 5.1 5.9
03PC03-16 60 5.57 7
03PC04-15 9 0.26 0.21
03PC04-15 15 0.64 0.77
03PC04-15 22 0.99 1.5
03PC04-15 29 1.83 2.6
03PC04-15 36 2.25 3.7
03PC04-15 43 3.23 4.8
03PC04-15 50 4.82 5.9
03PC04-15 53 5.2 5.9
03PC04-15 60 5.64 7
03PC05-15 11 0.42 0.21
03PC05-15 18 0.94 0.77
03PC05-15 25 0.83 1.5
03PC05-15 32 1.5 2.6
03PC05-15 39 2.28 3.7
03PC05-15 46 2.92 4.8
03PC05-15 49 3.3 5.9
03PC05-15 56 3.55 7
03PC06-16 11 0.42 0.21
03PC06-16 18 0.94 0.77
03PC06-16 25 0.84 1.5
03PC06-16 32 1.53 2.6
03PC06-16 39 2.69 3.7
03PC06-16 46 3.82 4.8
03PC06-16 49 4.3 5.9
03PC06-16 56 5.37 7
03PC07-15 12 0.42 0.21
03PC07-15 18 0.94 0.77
03PC07-15 25 0.99 1.5
03PC07-15 32 1.82 2.6
03PC07-15 39 2.65 3.7
03PC07-15 46 3.04 4.8
03PC07-15 53 3.45 5.9
03PC07-15 56 3.9 7
03PC07-15 63 4.77 8.1
03PC08-14 11 0.37 0.21
03PC08-14 17 0.84 0.77
03PC08-14 24 0.99 1.5
03PC08-14 31 1.75 2.6
03PC08-14 38 2.45 3.7
03PC08-14 45 3.07 4.8
03PC08-14 52 3.45 5.9
03PC08-14 55 3.95 5.9
03PC08-14 62 4.72 7
03PD01-14 7 0.19 0.21
03PD01-14 13 0.53 0.21
03PD01-14 20 1.14 0.77
03PD01-14 27 0.7 1.5
03PD01-14 34 1.75 2.6
03PD01-14 41 2.64 3.7
03PD01-14 48 3.49 4.8
03PD01-14 51 4.2 5.9
03PD01-14 58 5.2 7
03PD02-14 7 0.19 0.21
03PD02-14 13 0.53 0.21
03PD02-14 20 1.14 0.77
03PD02-14 27 0.85 1.5
03PD02-14 34 1.85 2.6
03PD02-14 41 2.85 3.7
03PD02-14 48 5.35 4.8
03PD02-14 51 5.5 5.9
03PD02-14 58 6.5 7
03PD03-14 11 0.37 0.21
03PD03-14 17 0.84 0.77
03PD03-14 24 0.78 1.5
03PD03-14 31 1.78 2.6
03PD03-14 38 2.55 3.7
03PD03-14 45 3.43 4.8
03PD03-14 52 5.2 5.9
03PD03-14 55 5.4 5.9
03PD03-14 62 6.2 7
03PD04-14 9 0.26 0.21
03PD04-14 15 0.64 0.77
03PD04-14 22 0.65 1.5
03PD04-14 29 1.84 2.6
03PD04-14 36 2.62 3.7
03PD04-14 43 3.38 4.8
03PD04-14 50 5.51 5.9
03PD04-14 53 5.85 5.9
03PD04-14 60 6.95 7
03PD05-15 7 0.19 0.21
03PD05-15 13 0.53 0.21
03PD05-15 20 1.14 0.77
03PD05-15 27 0.55 1.5
03PD05-15 34 1.53 2.6
03PD05-15 41 2.7 3.7
03PD05-15 48 3.57 4.8
03PD05-15 51 4.1 5.9
03PD05-15 58 5.1 7
03PD06-14 9 0.26 0.21
03PD06-14 15 0.64 0.77
03PD06-14 22 0.6 1.5
03PD06-14 29 1.7 2.6
03PD06-14 36 2.76 3.7
03PD06-14 43 3.37 4.8
03PD06-14 50 4.36 5.9
03PD06-14 53 4.7 5.9
03PD06-14 60 5.6 7
03PD07-15 7 0.22 0.21
03PD07-15 10 0.37 0.21
03PD07-15 17 0.84 0.77
03PD08-15 9 0.26 0.21
03PD08-15 15 0.64 0.77
03PD08-15 22 0.7 1.5
03PD08-15 29 1.85 2.6
03PD08-15 36 2.65 3.7
03PD08-15 43 3.4 4.8
03PD08-15 50 5.15 5.9
03PD08-15 53 5.6 5.9
03PD08-15 60 6.6 7
05PA05-13 11 0 0.21
05PA05-13 17 0 0.77
05PA05-13 24 0 1.5
05PA05-13 25 0 1.5
05PB01-14 9 0 0.21
05PB01-14 9 0 0.21
05PB01-14 22 1.4 1.5
05PB01-14 30 2.4 2.6
06PA01-13 10 0.37 0.21
06PA01-13 17 0.84 0.77
06PA01-13 24 1.1 1.5
06PA01-13 31 2.3 2.6
06PA01-13 34 3.23 2.6
06PA01-13 41 4.61 3.7
06PA02-14 10 0.37 0.21
06PA02-14 17 0.84 0.77
06PA02-14 24 1 1.5
06PA02-14 31 2.1 2.6
06PA02-14 34 3.23 2.6
06PA02-14 41 4.1 3.7
06PA03-14 12 0.48 0.21
06PA03-14 19 1.04 0.77
06PA03-14 26 0.75 1.5
06PA03-14 29 2 2.6
06PA03-14 36 2.52 3.7
06PA04-13 12 0.48 0.21
06PA04-13 19 1.04 0.77
06PA04-13 26 0.82 1.5
06PA04-13 29 2.08 2.6
06PA04-13 36 2.6 3.7
06PA05-14 11 0.42 0.21
06PA05-14 18 0.94 0.77
06PA05-14 25 0.73 1.5
06PA05-14 28 2.16 2.6
06PA05-14 35 2.4 3.7
06PA06-14 11 0.42 0.21
06PA06-14 18 0.94 0.77
06PA06-14 25 0.81 1.5
06PA06-14 28 2.16 2.6
06PA06-14 35 2.8 3.7
06PA07-14 13 0.53 0.21
06PA07-14 20 1.14 0.77
06PA07-14 27 0.89 1.5
06PA07-14 30 2.09 2.6
06PA07-14 37 2.75 3.7
06PA08-14 13 0.53 0.21
06PA08-14 20 1.14 0.77
06PA08-14 27 0.91 1.5
06PA08-14 30 2.11 2.6
06PA08-14 37 2.82 3.7
06PB01-13 10 0.37 0.21
06PB01-13 17 0.84 0.77
06PB01-13 24 1 1.5
06PB01-13 31 2.2 2.6
06PB01-13 34 3.23 2.6
06PB01-13 41 4.48 3.7
06PB02-13 10 0.37 0.21
06PB02-13 17 0.84 0.77
06PB02-13 24 0.6 1.5
06PB02-13 31 1.61 2.6
06PB02-13 34 3.23 2.6
06PB02-13 41 3.5 3.7
06PB03-13 11 0.42 0.21
06PB03-13 18 0.94 0.77
06PB03-13 25 0.85 1.5
06PB03-13 28 2.16 2.6
06PB03-13 35 3 3.7
06PB04-13 11 0.42 0.21
06PB04-13 18 0.94 0.77
06PB04-13 25 0.73 1.5
06PB04-13 28 2.16 2.6
06PB04-13 35 2.5 3.7
06PB05-13 11 0.42 0.21
06PB05-13 18 0.94 0.77
06PB05-13 25 0.85 1.5
06PB05-13 28 2.3 2.6
06PB05-13 35 3 3.7
06PB06-13 11 0.42 0.21
06PB06-13 18 0.94 0.77
06PB06-13 25 1 1.5
06PB06-13 28 2.16 2.6
06PB06-13 35 2.8 3.7
06PB07-13 13 0.53 0.21
06PB07-13 20 1.14 0.77
06PB07-13 27 0.75 1.5
06PB07-13 30 0.95 2.6
06PB07-13 37 2.5 3.7
06PB08-14 13 0.53 0.21
06PB08-14 20 1.14 0.77
06PB08-14 27 0.9 1.5
06PB08-14 30 1.2 2.6
06PB08-14 37 3.5 3.7
06PC07-13 7 0.22 0.21
06PC07-13 14 0.59 0.77
06PC07-13 21 1.24 1.5
06PC07-13 24 0.88 1.5
06PC07-13 31 2 2.6
06PC08-13 13 0.19 0.21
06PC08-13 20 0.19 0.77
06PC08-13 23 0.19 1.5
I want the data to be like these
+------------+------------+------------+------------+------------+--------+
| 01PA05-18 | 01PA06-18 | 01PA07-18 | 01PA08-18 | 01PA09-18 | Target |
+-----+------+-----+------+-----+------+-----+------+-----+------+--------+
| DOC | ABW | DOC | ABW | DOC | ABW | DOC | ABW | DOC | ABW | ABW |
+-----+------+-----+------+-----+------+-----+------+-----+------+--------+
| 6 | 0 | 5 | 0 | 5 | 0 | 5 | 0 | 5 | 0 | 0.2 |
| 13 | 0.53 | 12 | 0.48 | 12 | 0.48 | 12 | 0.48 | 12 | 0.48 | 0.77 |
| 20 | 1.14 | 19 | 1.04 | 19 | 1.04 | 19 | 1.04 | 19 | 1.04 | 1.5 |
| 27 | 0.92 | 26 | 0.74 | 26 | 0.72 | 26 | 0.7 | 26 | 0.71 | 2.6 |
| 34 | 1.49 | 33 | 1.25 | 33 | 1.32 | 33 | 1.30 | 33 | 1.22 | 3.7 |
| 41 | 1.91 | 40 | 1.82 | 40 | 1.84 | 40 | 1.80 | 40 | 1.85 | 4.8 |
| 48 | 2.64 | 47 | 3.12 | 47 | 3.05 | 47 | 3.07 | 47 | 2.90 | 5.9 |
| 55 | 3.69 | 54 | 4.40 | 54 | 4.12 | 54 | 3.72 | 54 | 3.74 | 7 |
| 62 | 4.19 | 61 | 5.44 | 61 | 5.21 | 61 | 4.52 | 61 | 4.40 | 8.1 |
| 65 | 4.72 | 64 | 6.46 | 64 | 6.00 | 64 | 5.11 | 64 | 4.92 | 9.2 |
| 72 | 5.74 | 71 | 7.30 | 71 | 6.90 | 71 | 5.87 | 71 | 5.78 | 10.3 |
+-----+------+-----+------+-----+------+-----+------+-----+------+--------+

try using case
Case when PondCrop =01PA03-18
then //your code
else //your code
end case as 01PA03-18

Related

having issue animating my svg file using css

I find this interesting documentation, that shows how to make an svg file animated.
https://css-tricks.com/svg-line-animation-works/
However, I am having issue with making my project look like it is being completed when open.
I want my project to animate similar to section 8 of the above doc.. Help please
[newbie]
https://jsfiddle.net/yoavf1bu/17/
.path {
stroke-dasharray: 50;
stroke-dashoffset: 500;
animation: dash 5s linear forwards;
}
#keyframes dash {
to {
stroke-dashoffset: 0;
}
}
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="500pt" height="500pt " viewBox="0 0 200.000000 1000.000000"
preserveAspectRatio="xMidYMid meet">
<g transform="translate(0.000000,900.000000) scale(0.100000,-0.100000)"
>
<path class="path" stroke="#000000" stroke-width="25"
d="M3150 8544 c-208 -38 -355 -106 -479 -221 -40 -36 -75 -62 -80 -57
-4 5 -20 26 -35 48 -30 40 -93 75 -136 76 -41 0 -122 -44 -161 -86 -207 -230
-226 -724 -37 -939 53 -60 108 -88 175 -88 54 0 83 13 137 62 l29 26 -6 -75
c-20 -233 -161 -474 -261 -444 -37 11 -84 52 -132 117 -149 196 -182 227 -244
227 -61 0 -124 -53 -197 -167 -46 -73 -225 -423 -298 -583 -62 -135 -62 -136
-70 -128 -11 11 -57 268 -70 398 -34 315 -13 540 76 838 12 37 11 44 -1 52
-27 17 -54 -14 -110 -126 -65 -127 -111 -263 -144 -424 -70 -333 -90 -823 -41
-986 22 -76 48 -104 95 -104 48 0 86 30 142 114 23 33 42 62 43 64 1 1 18 -13
38 -33 39 -39 83 -47 110 -17 8 9 39 53 67 96 125 192 279 371 296 345 17 -29
17 -284 -1 -391 -34 -207 -88 -336 -244 -588 -174 -280 -289 -541 -337 -761
-14 -64 -19 -127 -19 -269 0 -171 2 -193 28 -293 54 -206 144 -388 284 -574
60 -81 77 -113 99 -183 57 -189 137 -405 254 -690 210 -508 252 -673 330
-1285 47 -366 77 -486 173 -685 91 -188 157 -268 198 -242 14 9 25 9 39 2 31
-17 50 -12 67 19 15 25 20 27 40 18 18 -8 27 -6 43 8 34 31 33 51 -9 148 -83
194 -90 278 -36 432 37 107 44 169 21 213 -19 37 -39 53 -121 97 -141 76 -140
74 -139 350 1 121 9 303 18 405 9 102 20 222 23 268 l6 82 -27 0 c-15 0 -29
-6 -31 -13 -11 -29 -46 -509 -52 -697 -9 -307 11 -367 145 -434 104 -52 132
-80 132 -127 0 -22 -12 -67 -26 -102 -36 -86 -52 -187 -42 -261 9 -68 41 -171
71 -231 19 -39 19 -40 0 -23 -40 36 -64 19 -56 -38 7 -46 -12 -50 -43 -9 -29
39 -48 44 -63 18 -10 -17 -12 -17 -27 2 -26 34 -132 257 -153 325 -33 99 -59
243 -92 500 -70 554 -120 761 -266 1120 -156 383 -186 459 -244 623 -32 92
-59 170 -59 174 0 3 35 -28 78 -68 265 -253 563 -473 1040 -769 l183 -113 63
-91 c472 -677 602 -958 831 -1791 36 -129 49 -155 79 -155 13 0 29 6 35 14 8
9 24 12 49 9 28 -4 44 0 65 17 15 12 27 28 27 36 0 9 11 14 30 14 17 0 39 9
51 21 27 27 23 73 -20 218 -41 139 -42 214 -1 319 45 118 54 169 40 222 -19
69 -64 105 -157 125 -43 9 -86 19 -96 23 -13 5 -36 51 -68 137 -110 289 -267
511 -462 658 -58 44 -245 163 -399 256 -15 9 -85 97 -155 196 -71 99 -190 266
-264 370 -273 382 -323 468 -322 560 1 64 18 116 141 415 86 210 113 320 113
470 0 152 -36 274 -120 403 -58 88 -118 143 -204 185 l-66 32 -25 82 c-44 144
-49 175 -43 271 14 262 212 597 411 699 60 31 143 35 192 10 103 -53 261 -257
461 -597 66 -111 75 -135 128 -320 68 -238 116 -377 157 -459 158 -315 449
-556 750 -621 75 -16 94 -13 101 17 7 24 -3 35 -151 151 -257 203 -474 482
-774 997 -82 141 -86 150 -141 350 -83 303 -133 452 -191 575 -63 133 -124
210 -197 250 -46 26 -64 30 -124 29 -90 -1 -161 -28 -275 -106 -424 -286 -879
-1098 -977 -1745 -22 -149 -22 -506 0 -663 19 -129 52 -304 63 -335 15 -43
-26 11 -90 118 -164 274 -225 555 -182 846 33 224 147 505 316 781 180 294
209 357 258 550 24 96 27 122 27 300 0 162 -3 201 -17 233 -13 29 -23 37 -43
37 -72 0 -150 -83 -340 -358 -73 -107 -78 -112 -95 -97 -10 9 -23 29 -30 45
-12 30 -7 43 161 395 62 131 189 366 229 426 45 65 103 119 129 119 30 0 67
-36 145 -139 130 -171 200 -222 283 -206 84 15 203 185 246 350 35 134 44 343
16 361 -17 10 -47 -7 -53 -30 -3 -12 -31 -46 -61 -76 -56 -52 -57 -52 -110
-48 -116 10 -196 133 -227 348 -35 249 68 546 214 621 64 33 113 10 166 -79
l19 -33 -38 -77 c-70 -141 -84 -292 -35 -364 18 -28 28 -33 68 -36 40 -3 48 0
71 28 15 17 31 47 37 68 17 61 12 199 -11 292 l-20 85 79 76 c61 59 100 87
173 123 173 85 368 115 529 81 121 -26 135 -25 135 5 0 38 -87 61 -245 65 -69
2 -136 1 -150 -1z m-543 -579 c6 -107 -9 -169 -42 -182 -64 -24 -62 177 2 302
l16 30 9 -25 c6 -14 12 -70 15 -125z m-1392 -987 c0 -195 4 -280 18 -368 21
-135 50 -277 70 -340 14 -44 13 -47 -16 -103 -34 -66 -102 -147 -123 -147 -7
0 -20 12 -28 28 -58 112 -45 624 24 963 17 85 51 219 54 219 1 0 1 -114 1
-252z m1622 -459 c126 -32 232 -221 353 -633 41 -139 46 -176 14 -114 -49 96
-206 311 -289 394 -107 107 -149 129 -248 122 -86 -5 -158 -42 -252 -130 -131
-122 -245 -322 -296 -517 -29 -114 -23 -268 15 -386 32 -101 32 -105 -2 -105
-45 0 -129 -29 -183 -61 -64 -40 -140 -126 -183 -208 -159 -305 -106 -641 119
-752 58 -28 71 -31 137 -27 93 5 169 39 243 109 164 155 176 350 44 728 -22
63 -37 116 -35 119 10 9 78 -42 127 -96 57 -64 120 -186 143 -278 9 -34 16
-103 16 -153 0 -158 -33 -275 -156 -562 -75 -177 -109 -301 -99 -367 13 -89
118 -256 464 -735 94 -131 171 -240 171 -242 0 -14 -465 291 -626 410 -197
145 -321 251 -475 405 l-146 145 -32 135 c-114 491 -115 903 -5 1295 36 129
145 396 225 558 252 502 591 882 844 943 65 16 59 16 112 3z m673 -1379 c204
-338 409 -592 625 -775 44 -38 82 -70 85 -72 3 -3 -9 -1 -25 3 -39 9 -232 107
-269 136 -128 101 -211 189 -281 298 -90 138 -129 233 -211 515 -10 32 8 8 76
-105z m-1290 -132 c92 -242 134 -450 112 -554 -24 -118 -86 -201 -192 -259
-48 -26 -65 -30 -130 -30 -65 1 -81 4 -122 30 -94 59 -151 186 -151 336 1 194
99 404 234 500 42 30 127 58 176 59 l41 0 32 -82z m1067 -2670 c146 -93 230
-157 306 -235 132 -134 244 -317 321 -525 61 -165 61 -165 189 -188 45 -8 79
-21 98 -37 25 -22 29 -31 29 -79 0 -36 -10 -80 -30 -132 -60 -158 -61 -195 -4
-396 19 -66 34 -126 34 -133 0 -19 -14 -16 -35 7 -11 12 -28 20 -39 18 -18 -3
-21 -11 -22 -51 0 -26 -4 -50 -8 -55 -10 -9 -36 27 -36 50 0 10 -7 21 -15 24
-22 9 -45 -14 -45 -44 0 -53 -19 -3 -70 183 -103 379 -211 676 -340 935 -93
188 -159 295 -423 692 -11 16 -16 28 -13 28 3 0 50 -28 103 -62z"/>
</g>
</svg>
There are two reasons in your application that interfere with work:
To animate drawing a line from zero to maximum, the condition must be met:
stroke-dasharray= stroke="dashofffset"
Your values are different
The SVG shape should be drawn with a single contour
You have a double contour:
I drew your shape in a vector editor with a single contour:
We will animate this contour in the same way as indicated in your link.
.path {
fill:none;
stroke:black;
stroke-width:4;
stroke-linecap:round;
stroke-dasharray: 3500;
stroke-dashoffset: 3500;
animation: dash 10s linear forwards infinite;
}
#keyframes dash {
to {
stroke-dashoffset: 0;
}
}
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.0" width="309" height="584 " viewBox="0 0 309 584">
<path class="path" d="M215 31s-13-3-20-3c-7 1-14 2-20 5-5 2-11 6-15 11-4 4-8 9-10 15-2 5-4 11-3 16 0 3 7 7 8 2 2-4 2-10 2-14-1-7-2-13-6-18-2-3-5-6-8-6-6 0-11 6-14 11-3 4-4 10-5 16v22c1 5 3 10 6 14 3 3 7 6 11 6s7-3 9-5 3-8 4-6c2 5 0 11-1 16l-4 14c-2 4-4 8-7 10s-5 4-8 3c-5 0-7-5-10-8l-7-10c-2-2-4-5-7-5-5 1-9 7-11 10l-7 13-11 22-10 21-7 10c-2 1-4 2-6 1s-3-6-3-9l-1-13v-19l3-21 3-17 6-16 5-9-3 16-3 19 1 20a368 368 0 0 0 4 26c1 4 2 9 5 12 1 2 2 5 4 5 3-1 4-5 6-8l5-8 6-7 4-5c2-2 3-4 5-3 3 0 3 5 4 7l-2 13-1 16-4 10-7 14-6 9-4 9-7 12-5 15-3 10-2 15 1 20 5 15 8 16 12 16 15 15 18 14 24 19 28 17 18 10 20 15 14 17 11 21 2 7 5 5h8c3 1 5 3 6 5v8c-2 5-5 9-5 14l2 12 3 11 1 5-3 2c-2 0-3-4-5-3v4l-1 4-4-1c-1-2 1-5-1-5s1 8-2 7c-4-2-6-20-6-20l-6-18-7-18-8-18-7-15-12-16-6-11-5-9-12-18-19-26-14-20-7-12-2-4c-1-8 2-13 4-20l5-10c2-6 6-13 7-19v-18c-1-6-2-12-5-18l-8-10c-5-3-11-6-17-5-6 0-11 3-16 7-5 6-8 14-10 22-1 6-2 13 0 19 1 5 3 10 8 13 6 4 11 4 16 2 6-2 11-6 15-11 2-3 3-8 3-13 0-8-2-15-4-23l-4-12-5-12-2-7a56 56 0 0 1 4-30 68 68 0 0 1 18-24c4-3 7-6 12-7 5 0 9 3 13 6 5 3 9 9 13 15 5 6 8 14 12 20l16 26 15 24a250 250 0 0 0 31 34l8 6 3 2c-4 1-10-1-15-3-6-2-10-6-16-10s-11-9-15-15c-5-5-7-12-10-19-4-8-6-16-8-25l-7-25c-3-12-6-24-11-35-3-6-7-13-11-16-3-2-7-3-10-3-5 0-10 2-15 4l-16 14-13 17-10 18-11 19s-8 17-10 26l-5 25-1 25a253 253 0 0 0 5 35c2 11 5 21 9 32 3 10 12 29 12 29l9 23a361 361 0 0 0 13 62l2 17 3 13 4 12 5 8c2 4 2 13 7 12 2 0-2-5 0-6 2 0 2 5 4 6l2-1c2-2-1-7 2-8 2-1 2 6 5 5 2 0 0-5-1-7l-4-9-1-11 3-12 2-6-2-6-10-5-6-8-1-13 1-16 1-15 2-20" />
</svg>
Do you want something like this:
.path {
stroke-dasharray: 60000;
stroke-dashoffset: 60000;
animation: dash 10s linear forwards infinite;
}
#keyframes dash {
to {
stroke-dashoffset: 0;
}
}
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="500pt" height="500pt " viewBox="0 0 200.000000 1000.000000"
preserveAspectRatio="xMidYMid meet">
<g transform="translate(0.000000,900.000000) scale(0.100000,-0.100000)"
>
<path class="path" fill="white" stroke="black" stroke-width="25"
d="M3150 8544 c-208 -38 -355 -106 -479 -221 -40 -36 -75 -62 -80 -57
-4 5 -20 26 -35 48 -30 40 -93 75 -136 76 -41 0 -122 -44 -161 -86 -207 -230
-226 -724 -37 -939 53 -60 108 -88 175 -88 54 0 83 13 137 62 l29 26 -6 -75
c-20 -233 -161 -474 -261 -444 -37 11 -84 52 -132 117 -149 196 -182 227 -244
227 -61 0 -124 -53 -197 -167 -46 -73 -225 -423 -298 -583 -62 -135 -62 -136
-70 -128 -11 11 -57 268 -70 398 -34 315 -13 540 76 838 12 37 11 44 -1 52
-27 17 -54 -14 -110 -126 -65 -127 -111 -263 -144 -424 -70 -333 -90 -823 -41
-986 22 -76 48 -104 95 -104 48 0 86 30 142 114 23 33 42 62 43 64 1 1 18 -13
38 -33 39 -39 83 -47 110 -17 8 9 39 53 67 96 125 192 279 371 296 345 17 -29
17 -284 -1 -391 -34 -207 -88 -336 -244 -588 -174 -280 -289 -541 -337 -761
-14 -64 -19 -127 -19 -269 0 -171 2 -193 28 -293 54 -206 144 -388 284 -574
60 -81 77 -113 99 -183 57 -189 137 -405 254 -690 210 -508 252 -673 330
-1285 47 -366 77 -486 173 -685 91 -188 157 -268 198 -242 14 9 25 9 39 2 31
-17 50 -12 67 19 15 25 20 27 40 18 18 -8 27 -6 43 8 34 31 33 51 -9 148 -83
194 -90 278 -36 432 37 107 44 169 21 213 -19 37 -39 53 -121 97 -141 76 -140
74 -139 350 1 121 9 303 18 405 9 102 20 222 23 268 l6 82 -27 0 c-15 0 -29
-6 -31 -13 -11 -29 -46 -509 -52 -697 -9 -307 11 -367 145 -434 104 -52 132
-80 132 -127 0 -22 -12 -67 -26 -102 -36 -86 -52 -187 -42 -261 9 -68 41 -171
71 -231 19 -39 19 -40 0 -23 -40 36 -64 19 -56 -38 7 -46 -12 -50 -43 -9 -29
39 -48 44 -63 18 -10 -17 -12 -17 -27 2 -26 34 -132 257 -153 325 -33 99 -59
243 -92 500 -70 554 -120 761 -266 1120 -156 383 -186 459 -244 623 -32 92
-59 170 -59 174 0 3 35 -28 78 -68 265 -253 563 -473 1040 -769 l183 -113 63
-91 c472 -677 602 -958 831 -1791 36 -129 49 -155 79 -155 13 0 29 6 35 14 8
9 24 12 49 9 28 -4 44 0 65 17 15 12 27 28 27 36 0 9 11 14 30 14 17 0 39 9
51 21 27 27 23 73 -20 218 -41 139 -42 214 -1 319 45 118 54 169 40 222 -19
69 -64 105 -157 125 -43 9 -86 19 -96 23 -13 5 -36 51 -68 137 -110 289 -267
511 -462 658 -58 44 -245 163 -399 256 -15 9 -85 97 -155 196 -71 99 -190 266
-264 370 -273 382 -323 468 -322 560 1 64 18 116 141 415 86 210 113 320 113
470 0 152 -36 274 -120 403 -58 88 -118 143 -204 185 l-66 32 -25 82 c-44 144
-49 175 -43 271 14 262 212 597 411 699 60 31 143 35 192 10 103 -53 261 -257
461 -597 66 -111 75 -135 128 -320 68 -238 116 -377 157 -459 158 -315 449
-556 750 -621 75 -16 94 -13 101 17 7 24 -3 35 -151 151 -257 203 -474 482
-774 997 -82 141 -86 150 -141 350 -83 303 -133 452 -191 575 -63 133 -124
210 -197 250 -46 26 -64 30 -124 29 -90 -1 -161 -28 -275 -106 -424 -286 -879
-1098 -977 -1745 -22 -149 -22 -506 0 -663 19 -129 52 -304 63 -335 15 -43
-26 11 -90 118 -164 274 -225 555 -182 846 33 224 147 505 316 781 180 294
209 357 258 550 24 96 27 122 27 300 0 162 -3 201 -17 233 -13 29 -23 37 -43
37 -72 0 -150 -83 -340 -358 -73 -107 -78 -112 -95 -97 -10 9 -23 29 -30 45
-12 30 -7 43 161 395 62 131 189 366 229 426 45 65 103 119 129 119 30 0 67
-36 145 -139 130 -171 200 -222 283 -206 84 15 203 185 246 350 35 134 44 343
16 361 -17 10 -47 -7 -53 -30 -3 -12 -31 -46 -61 -76 -56 -52 -57 -52 -110
-48 -116 10 -196 133 -227 348 -35 249 68 546 214 621 64 33 113 10 166 -79
l19 -33 -38 -77 c-70 -141 -84 -292 -35 -364 18 -28 28 -33 68 -36 40 -3 48 0
71 28 15 17 31 47 37 68 17 61 12 199 -11 292 l-20 85 79 76 c61 59 100 87
173 123 173 85 368 115 529 81 121 -26 135 -25 135 5 0 38 -87 61 -245 65 -69
2 -136 1 -150 -1z m-543 -579 c6 -107 -9 -169 -42 -182 -64 -24 -62 177 2 302
l16 30 9 -25 c6 -14 12 -70 15 -125z m-1392 -987 c0 -195 4 -280 18 -368 21
-135 50 -277 70 -340 14 -44 13 -47 -16 -103 -34 -66 -102 -147 -123 -147 -7
0 -20 12 -28 28 -58 112 -45 624 24 963 17 85 51 219 54 219 1 0 1 -114 1
-252z m1622 -459 c126 -32 232 -221 353 -633 41 -139 46 -176 14 -114 -49 96
-206 311 -289 394 -107 107 -149 129 -248 122 -86 -5 -158 -42 -252 -130 -131
-122 -245 -322 -296 -517 -29 -114 -23 -268 15 -386 32 -101 32 -105 -2 -105
-45 0 -129 -29 -183 -61 -64 -40 -140 -126 -183 -208 -159 -305 -106 -641 119
-752 58 -28 71 -31 137 -27 93 5 169 39 243 109 164 155 176 350 44 728 -22
63 -37 116 -35 119 10 9 78 -42 127 -96 57 -64 120 -186 143 -278 9 -34 16
-103 16 -153 0 -158 -33 -275 -156 -562 -75 -177 -109 -301 -99 -367 13 -89
118 -256 464 -735 94 -131 171 -240 171 -242 0 -14 -465 291 -626 410 -197
145 -321 251 -475 405 l-146 145 -32 135 c-114 491 -115 903 -5 1295 36 129
145 396 225 558 252 502 591 882 844 943 65 16 59 16 112 3z m673 -1379 c204
-338 409 -592 625 -775 44 -38 82 -70 85 -72 3 -3 -9 -1 -25 3 -39 9 -232 107
-269 136 -128 101 -211 189 -281 298 -90 138 -129 233 -211 515 -10 32 8 8 76
-105z m-1290 -132 c92 -242 134 -450 112 -554 -24 -118 -86 -201 -192 -259
-48 -26 -65 -30 -130 -30 -65 1 -81 4 -122 30 -94 59 -151 186 -151 336 1 194
99 404 234 500 42 30 127 58 176 59 l41 0 32 -82z m1067 -2670 c146 -93 230
-157 306 -235 132 -134 244 -317 321 -525 61 -165 61 -165 189 -188 45 -8 79
-21 98 -37 25 -22 29 -31 29 -79 0 -36 -10 -80 -30 -132 -60 -158 -61 -195 -4
-396 19 -66 34 -126 34 -133 0 -19 -14 -16 -35 7 -11 12 -28 20 -39 18 -18 -3
-21 -11 -22 -51 0 -26 -4 -50 -8 -55 -10 -9 -36 27 -36 50 0 10 -7 21 -15 24
-22 9 -45 -14 -45 -44 0 -53 -19 -3 -70 183 -103 379 -211 676 -340 935 -93
188 -159 295 -423 692 -11 16 -16 28 -13 28 3 0 50 -28 103 -62z"/>
</g>
</svg>
Add fill="white" to the svg for creating blank space, and just set time to 10s so you can change it based on your project

Problem getting data with NBA API: JSONDecodeError: Expecting value: line 1 column 1 (char 0)

I run the following code for getting data from the NBA API and Im getting the above mentioned error. Any help is appreciated.
from nba_api.stats.endpoints import leaguedashteamstats
import requests
import json
import pandas as pd
response = leaguedashteamstats.LeagueDashTeamStats(
team_id=0,
game_ids= 0,
league_id=0,
season= '2020-21',
season_type_all_star='Regular Season'
Seems like this package has not been updated for about 10 months now. You need to a) include the headers parameter (I believe it's the "Referer" one specifically that the api needs, otherwise it just "hangs" and you'll get a timeout.
But then b) you also need to have the query parameters match what the endpoint needs. Specifically, for, the league_id needs to be '00', having 0 won't work.
I personally am a fan of just going to the source instead of using this wrapper, but it still works given the correct parameters used.
from nba_api.stats.endpoints import leaguedashteamstats
import requests
import json
import pandas as pd
response = leaguedashteamstats.LeagueDashTeamStats(
team_id_nullable='0',
league_id_nullable='00',
season= '2020-21',
season_type_all_star='Regular Season',
headers={'Accept': 'application/json, text/plain, */*',
'Accept-Encoding': 'gzip, deflate, br',
'Accept-Language': 'en-US,en;q=0.9',
'Connection': 'keep-alive',
'Host': 'stats.nba.com',
'Origin': 'https://www.nba.com',
'Referer': 'https://www.nba.com/',
'sec-ch-ua': '"Google Chrome";v="87", "\"Not;A\\Brand";v="99", "Chromium";v="87"',
'sec-ch-ua-mobile': '?1',
'Sec-Fetch-Dest': 'empty',
'Sec-Fetch-Mode': 'cors',
'Sec-Fetch-Site': 'same-site',
'User-Agent': 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Mobile Safari/537.36',
'x-nba-stats-origin': 'stats',
'x-nba-stats-token': 'true'})
df = response.get_data_frames()[0]
Output:
print(df.to_string())
TEAM_ID TEAM_NAME GP W L W_PCT MIN FGM FGA FG_PCT FG3M FG3A FG3_PCT FTM FTA FT_PCT OREB DREB REB AST TOV STL BLK BLKA PF PFD PTS PLUS_MINUS GP_RANK W_RANK L_RANK W_PCT_RANK MIN_RANK FGM_RANK FGA_RANK FG_PCT_RANK FG3M_RANK FG3A_RANK FG3_PCT_RANK FTM_RANK FTA_RANK FT_PCT_RANK OREB_RANK DREB_RANK REB_RANK AST_RANK TOV_RANK STL_RANK BLK_RANK BLKA_RANK PF_RANK PFD_RANK PTS_RANK PLUS_MINUS_RANK CFID CFPARAMS
0 1610612737 Atlanta Hawks 72 41 31 0.569 48.3 40.8 87.2 0.468 12.4 33.4 0.373 19.7 24.2 0.812 10.6 35.1 45.6 24.1 13.2 7.0 4.8 5.0 19.3 19.8 113.7 2.3 1 11 11 11 11 19 23 17 17 19 12 2 4 5 7 10 5 19 9 24 17 17 18 9 13 9 10 Atlanta Hawks
1 1610612738 Boston Celtics 72 36 36 0.500 48.3 41.5 88.9 0.466 13.6 36.4 0.374 16.1 20.8 0.775 10.6 33.6 44.3 23.5 14.1 7.7 5.3 4.6 20.4 19.3 112.6 1.5 1 16 16 16 16 13 11 19 11 10 10 25 25 16 4 22 15 25 16 13 6 11 24 13 16 13 10 Boston Celtics
2 1610612751 Brooklyn Nets 72 48 24 0.667 48.3 43.1 87.3 0.494 14.2 36.1 0.392 18.1 22.5 0.804 8.9 35.5 44.4 26.8 13.5 6.7 5.3 4.6 19.0 18.9 118.6 4.5 1 4 4 4 11 6 21 1 7 12 2 5 8 6 27 5 14 7 13 27 7 9 13 18 2 7 10 Brooklyn Nets
3 1610612766 Charlotte Hornets 72 33 39 0.458 48.2 39.9 87.8 0.455 13.7 37.0 0.369 15.9 20.9 0.761 10.6 33.2 43.8 26.8 14.8 7.8 4.8 4.8 18.0 18.6 109.5 -1.9 1 19 19 19 19 22 20 22 10 9 14 26 24 21 6 25 19 5 24 10 16 14 5 21 23 23 10 Charlotte Hornets
4 1610612741 Chicago Bulls 72 31 41 0.431 48.3 42.2 88.6 0.476 12.6 34.0 0.370 13.8 17.5 0.791 9.6 35.3 45.0 26.8 15.1 6.7 4.2 5.1 18.9 17.7 110.7 -0.9 1 21 21 21 16 10 14 9 16 17 13 30 30 11 19 8 11 8 27 28 27 18 10 30 21 20 10 Chicago Bulls
5 1610612739 Cleveland Cavaliers 72 22 50 0.306 48.4 38.6 85.8 0.450 10.0 29.7 0.336 16.7 22.4 0.743 10.4 32.3 42.8 23.8 15.5 7.8 4.5 5.9 18.2 20.2 103.8 -8.4 1 26 26 26 6 29 28 25 29 28 30 14 9 26 10 28 24 21 29 12 20 29 7 6 30 28 10 Cleveland Cavaliers
6 1610612742 Dallas Mavericks 72 42 30 0.583 48.1 41.1 87.3 0.470 13.8 38.1 0.362 16.5 21.2 0.778 9.1 34.2 43.3 22.9 12.1 6.3 4.3 3.7 19.4 20.1 112.4 2.3 1 8 8 8 24 18 22 13 8 6 18 18 20 15 25 17 21 26 3 30 26 2 19 7 17 11 10 Dallas Mavericks
7 1610612743 Denver Nuggets 72 47 25 0.653 48.6 43.3 89.2 0.485 12.9 34.2 0.377 15.7 19.5 0.803 10.5 33.9 44.4 26.8 13.5 8.1 4.5 4.5 19.1 19.2 115.1 4.9 1 5 5 5 1 4 9 4 15 16 8 27 27 7 8 19 13 5 12 8 21 7 14 15 8 6 10 Denver Nuggets
8 1610612765 Detroit Pistons 72 20 52 0.278 48.4 38.7 85.6 0.452 11.6 32.9 0.351 17.8 23.4 0.759 9.6 33.1 42.7 24.2 14.9 7.4 5.2 5.8 20.5 20.4 106.6 -4.5 1 29 29 29 6 28 29 24 22 21 22 7 5 24 18 26 25 18 25 17 8 28 26 5 27 25 10 Detroit Pistons
9 1610612744 Golden State Warriors 72 39 33 0.542 48.1 41.3 88.2 0.468 14.6 38.7 0.376 16.6 21.1 0.785 8.0 35.1 43.0 27.7 15.0 8.2 4.8 4.3 21.2 19.5 113.7 1.1 1 14 14 14 24 15 17 14 3 5 9 16 21 13 30 12 22 1 26 6 17 6 28 11 12 14 10 Golden State Warriors
10 1610612745 Houston Rockets 72 17 55 0.236 48.1 39.3 88.5 0.444 13.8 40.6 0.339 16.5 22.3 0.740 9.3 33.3 42.6 23.6 14.7 7.6 5.0 5.3 19.5 19.3 108.8 -7.9 1 30 30 30 24 25 15 28 9 3 28 17 10 27 23 24 27 24 23 14 14 21 21 14 24 27 10 Houston Rockets
11 1610612754 Indiana Pacers 72 34 38 0.472 48.5 43.3 91.2 0.474 12.3 34.0 0.364 16.4 20.7 0.792 9.0 33.7 42.7 27.4 13.5 8.5 6.4 5.3 20.2 18.1 115.3 0.0 1 17 17 17 4 3 3 11 18 18 17 20 26 9 26 21 26 2 13 5 1 23 22 26 6 17 10 Indiana Pacers
12 1610612746 LA Clippers 72 47 25 0.653 48.0 41.8 86.7 0.482 14.3 34.7 0.411 16.2 19.3 0.839 9.4 34.7 44.2 24.4 13.2 7.1 4.1 4.2 19.2 18.1 114.0 6.2 1 5 5 5 30 12 25 5 6 14 1 24 28 1 21 14 17 17 7 20 29 5 17 27 10 2 10 LA Clippers
13 1610612747 Los Angeles Lakers 72 42 30 0.583 48.5 40.6 86.1 0.472 11.1 31.2 0.354 17.2 23.3 0.739 9.7 34.6 44.2 24.7 15.2 7.8 5.4 4.5 19.1 21.3 109.5 2.8 1 8 8 8 4 21 27 12 25 24 21 11 6 28 17 15 16 15 28 11 5 8 16 3 22 8 10 Los Angeles Lakers
14 1610612763 Memphis Grizzlies 72 38 34 0.528 48.3 42.8 91.8 0.467 11.2 31.4 0.356 16.4 21.3 0.771 11.2 35.3 46.5 26.9 13.3 9.1 5.1 5.2 18.7 18.3 113.3 1.0 1 15 15 15 11 7 2 18 24 23 20 19 17 18 2 9 4 4 10 1 12 20 9 25 15 15 10 Memphis Grizzlies
15 1610612748 Miami Heat 72 40 32 0.556 48.3 39.2 83.7 0.468 12.9 36.2 0.358 16.7 21.1 0.790 8.0 33.5 41.5 26.3 14.1 7.9 4.0 4.0 18.9 19.6 108.1 0.0 1 13 13 13 16 26 30 15 14 11 19 13 21 12 29 23 29 9 17 9 30 4 12 10 25 16 10 Miami Heat
16 1610612749 Milwaukee Bucks 72 46 26 0.639 48.1 44.7 91.8 0.487 14.4 37.1 0.389 16.2 21.4 0.760 10.3 37.8 48.1 25.5 13.8 8.1 4.6 4.8 17.3 18.3 120.1 5.9 1 7 7 7 22 1 1 3 5 8 5 23 16 23 12 1 2 14 15 7 19 15 2 24 1 3 10 Milwaukee Bucks
17 1610612750 Minnesota Timberwolves 72 23 49 0.319 48.3 40.7 90.9 0.448 13.1 37.6 0.349 17.6 23.1 0.761 10.5 33.0 43.5 25.6 14.3 8.8 5.5 5.5 20.9 19.9 112.1 -5.6 1 25 25 25 11 20 6 27 12 7 25 8 7 22 9 27 20 11 19 3 3 26 27 8 18 26 10 Minnesota Timberwolves
18 1610612740 New Orleans Pelicans 72 31 41 0.431 48.4 42.5 89.1 0.477 10.6 30.4 0.348 19.0 26.1 0.729 11.7 35.7 47.4 26.0 14.6 7.6 4.4 5.9 18.0 21.3 114.6 -0.3 1 21 21 21 6 9 10 7 27 25 26 4 2 29 1 3 3 10 22 15 24 30 4 2 9 18 10 New Orleans Pelicans
19 1610612752 New York Knicks 72 41 31 0.569 48.4 39.4 86.5 0.456 11.8 30.0 0.392 16.4 20.9 0.784 9.7 35.5 45.1 21.4 12.9 7.0 5.1 5.4 20.5 17.9 107.0 2.3 1 11 11 11 6 24 26 21 21 27 3 21 23 14 16 7 9 29 6 21 11 25 25 29 26 10 10 New York Knicks
20 1610612760 Oklahoma City Thunder 72 22 50 0.306 48.2 38.8 88.0 0.441 11.9 35.1 0.339 15.5 21.3 0.725 9.9 35.7 45.6 22.1 16.1 7.0 4.4 5.3 18.1 18.6 105.0 -10.6 1 26 26 26 19 27 19 29 20 13 29 29 17 30 14 3 6 27 30 23 23 21 6 23 28 30 10 Oklahoma City Thunder
21 1610612753 Orlando Magic 72 21 51 0.292 48.1 38.3 89.2 0.429 10.9 31.8 0.343 16.6 21.4 0.775 10.4 35.1 45.4 21.8 12.8 6.9 4.4 5.3 17.2 18.6 104.0 -9.3 1 28 28 28 22 30 8 30 26 22 27 15 15 17 11 10 7 28 5 25 22 24 1 20 29 29 10 Orlando Magic
22 1610612755 Philadelphia 76ers 72 49 23 0.681 48.4 41.4 86.9 0.476 11.3 30.1 0.374 19.6 25.5 0.767 10.0 35.0 45.1 23.7 14.4 9.1 6.2 4.7 20.2 21.0 113.6 5.6 1 3 3 3 6 14 24 8 23 26 11 3 3 20 13 13 10 22 21 1 2 12 23 4 14 5 10 Philadelphia 76ers
23 1610612756 Phoenix Suns 72 51 21 0.708 48.6 43.3 88.3 0.490 13.1 34.6 0.378 15.6 18.7 0.834 8.8 34.2 42.9 26.9 12.5 7.2 4.3 3.6 19.1 18.0 115.3 5.8 1 2 2 2 1 2 16 2 13 15 7 28 29 2 28 18 23 3 4 19 25 1 14 28 7 4 10 Phoenix Suns
24 1610612757 Portland Trail Blazers 72 42 30 0.583 48.1 41.3 91.1 0.453 15.7 40.8 0.385 17.8 21.6 0.823 10.6 33.9 44.5 21.3 11.1 6.9 5.0 4.6 18.9 19.1 116.1 1.8 1 8 8 8 24 15 4 23 2 2 6 6 13 3 3 20 12 30 1 25 13 10 10 16 5 12 10 Portland Trail Blazers
25 1610612758 Sacramento Kings 72 31 41 0.431 48.1 42.6 88.6 0.481 12.1 33.3 0.364 16.4 22.0 0.745 9.4 32.0 41.4 25.5 13.4 7.5 5.0 4.7 19.4 18.7 113.7 -3.7 1 21 21 21 24 8 13 6 19 20 16 21 11 25 22 30 30 12 11 16 15 13 20 19 11 24 10 Sacramento Kings
26 1610612759 San Antonio Spurs 72 33 39 0.458 48.6 41.9 90.5 0.462 9.9 28.4 0.350 17.4 22.0 0.792 9.3 34.6 43.9 24.4 11.4 7.0 5.1 5.1 18.0 18.6 111.1 -1.7 1 19 19 19 1 11 7 20 30 30 24 9 12 10 24 16 18 16 2 22 10 19 3 22 20 21 10 San Antonio Spurs
27 1610612761 Toronto Raptors 72 27 45 0.375 48.1 39.7 88.7 0.448 14.5 39.3 0.368 17.4 21.3 0.815 9.4 32.1 41.6 24.1 13.2 8.6 5.4 5.6 21.2 19.5 111.3 -0.5 1 24 24 24 24 23 12 26 4 4 15 10 17 4 20 29 28 20 8 4 4 27 28 12 19 19 10 Toronto Raptors
28 1610612762 Utah Jazz 72 52 20 0.722 48.2 41.3 88.1 0.468 16.7 43.0 0.389 17.2 21.5 0.799 10.6 37.6 48.3 23.7 14.2 6.6 5.2 3.9 18.5 19.0 116.4 9.3 1 1 1 1 19 17 18 16 1 1 4 12 14 8 4 2 1 23 18 29 8 3 8 17 4 1 10 Utah Jazz
29 1610612764 Washington Wizards 72 34 38 0.472 48.3 43.2 90.9 0.475 10.2 29.0 0.351 20.1 26.2 0.769 9.7 35.5 45.2 25.5 14.4 7.3 4.1 4.8 21.6 22.0 116.6 -1.8 1 17 17 17 11 5 5 10 28 29 23 1 1 19 15 6 8 13 20 18 28 15 30 1 3 22 10 Washington Wizards

Multi-GPU Peer-to-Peer Slow between Particular Pairs

I have 8 RTX GPUs. When run p2pBandwidthLatencyTest, The latencies between GPU0 and GPU1, GPU2 and GPU3, GPU4 and GPU5, GPU6 and GPU7 is 40,000 times slower than other pairs:
P2P=Enabled Latency (P2P Writes) Matrix (us)
GPU 0 1 2 3 4 5 6 7
0 1.80 49354.72 1.70 1.70 1.74 1.74 1.74 1.72
1 49354.84 1.37 1.70 1.69 1.74 1.76 1.73 1.72
2 1.88 1.81 1.73 49355.00 1.79 1.76 1.76 1.75
3 1.88 1.79 49354.85 1.33 3.79 3.84 3.88 3.91
4 1.89 1.88 1.90 1.87 1.72 49354.96 3.49 3.56
5 2.30 1.93 1.88 1.89 49354.89 1.32 3.63 3.60
6 2.55 2.53 2.37 2.29 2.24 2.26 3.50 49354.77
7 2.30 2.27 2.29 1.87 1.82 1.83 49354.85 1.36
Compare it with when peer-to-peer is disabled:
P2P=Disabled Latency Matrix (us)
GPU 0 1 2 3 4 5 6 7
0 1.80 14.31 13.86 13.49 14.52 13.89 13.58 13.58
1 13.71 1.82 14.44 13.95 14.65 13.62 15.05 15.20
2 13.38 14.23 1.73 16.59 13.77 15.44 14.10 13.64
3 12.68 15.62 12.50 1.77 14.92 15.01 15.17 14.87
4 13.51 13.60 15.09 13.40 1.27 12.48 12.68 19.47
5 14.92 13.84 13.42 13.42 16.53 1.30 16.37 16.60
6 14.29 13.62 14.66 13.62 14.90 13.70 1.32 14.33
7 14.26 13.42 14.35 13.53 16.89 14.26 17.03 1.36
Is this normal?
It turns out the super slow peer-to-peer is abnormal.
After I disable IOMMU (Intel VT-d) in the BIOS, the problem is gone:
P2P=Enabled Latency (P2P Writes) Matrix (us)
GPU 0 1 2 3 4 5 6 7
0 1.34 1.22 1.68 1.69 1.71 1.70 1.75 1.73
1 1.20 1.38 1.70 1.67 1.71 1.75 1.75 1.72
2 1.69 1.67 1.29 1.20 1.73 1.75 1.75 1.75
3 1.69 1.66 1.17 1.29 1.74 1.75 1.72 1.73
4 1.72 1.76 1.74 1.70 1.32 1.13 1.66 1.70
5 1.74 1.73 1.75 1.74 1.18 1.28 1.67 1.69
6 1.75 1.74 1.74 1.72 1.67 1.68 1.31 1.19
7 1.76 1.75 1.73 1.73 1.67 1.69 1.18 1.32
It seems the problem is the same as or is very similar to discussions in:
https://github.com/pytorch/pytorch/issues/1637
https://github.com/pytorch/pytorch/issues/24081
A few possible solutions are mentioned in the discussions:
Disable IOMMU:
https://github.com/pytorch/pytorch/issues/1637#issuecomment-338268158
https://github.com/pytorch/pytorch/issues/1637#issuecomment-401422046
Disable ACS:
https://github.com/pytorch/pytorch/issues/24081#issuecomment-557074611
https://github.com/pytorch/pytorch/issues/24081#issuecomment-547976127
My system having the problem only had IOMMU enabled in the BIOS. ACS was not turned on as lspci -vvv | grep ACS got back nothing.
==============================
Background on I/O MMU:
https://en.wikipedia.org/wiki/X86_virtualization#I/O_MMU_virtualization_(AMD-Vi_and_Intel_VT-d)
It's part of the x86 virtualization. It's the virtualization done by the chipset. Besides the name IOMMU, it's also called AMD-Vi or Intel VT-d. Not to be confused with AMD-V and Intel VT-x which are virtualization via the CPU.

Gradient descent doesn't converge

Here is my own implementation of gradient descent algorithm in matlab language
m = height(data_training); % number of samples
cols = {'x1', 'x2', 'x3', 'x4', 'x5', 'x6',...
'x7', 'x8','x9', 'x10', 'x11', 'x12', 'x13', 'x14', 'x15'};
y = data_training{:, {'y'}}';
X = [ones(m,1) data_training{:,cols}]';
theta = zeros(1,width(data_training));
alpha = 1e-2; % learning rate
iter = 400;
dJ = zeros(1,width(data_training));
J_seq = zeros(1, iter);
for n = 1:iter
err = (theta*X - y);
for j = 1:width(data_training)
dJ(j) = 1/m*sum(err*X(j,:)');
end
J = 1/(2*m)*sum((theta*X-y).^2);
theta = theta - alpha.*dJ;
J_seq(n) = J;
if mod(n,100) == 0
plot(1:iter, J_seq);
end
end
EDIT
WORKING ALGORITHM
I have applied this algorithm to the following training dataset. The last column is the output variable. Here we have 15 different features.
For a reason for me unknown, when I plot the cost function J after 50 iterations in order to check if it is going towards the convergence, I see it doesn't convergence. Can you help me to understand? is it the implementation wrong or should I make something?
36 27 71 8.1 3.34 11.4 81.5 3243 8.8 42.6 11.7 21 15 59 59 921.87
35 23 72 11.1 3.14 11 78.8 4281 3.6 50.7 14.4 8 10 39 57 997.88
44 29 74 10.4 3.21 9.8 81.6 4260 0.8 39.4 12.4 6 6 33 54 962.35
47 45 79 6.5 3.41 11.1 77.5 3125 27.1 50.2 20.6 18 8 24 56 982.29
43 35 77 7.6 3.44 9.6 84.6 6441 24.4 43.7 14.3 43 38 206 55 1071.3
53 45 80 7.7 3.45 10.2 66.8 3325 38.5 43.1 25.5 30 32 72 54 1030.4
43 30 74 10.9 3.23 12.1 83.9 4679 3.5 49.2 11.3 21 32 62 56 934.7
45 30 73 9.3 3.29 10.6 86 2140 5.3 40.4 10.5 6 4 4 56 899.53
36 24 70 9 3.31 10.5 83.2 6582 8.1 42.5 12.6 18 12 37 61 1001.9
36 27 72 9.5 3.36 10.7 79.3 4213 6.7 41 13.2 12 7 20 59 912.35
52 42 79 7.7 3.39 9.6 69.2 2302 22.2 41.3 24.2 18 8 27 56 1017.6
33 26 76 8.6 3.2 10.9 83.4 6122 16.3 44.9 10.7 88 63 278 58 1024.9
40 34 77 9.2 3.21 10.2 77 4101 13 45.7 15.1 26 26 146 57 970.47
35 28 71 8.8 3.29 11.1 86.3 3042 14.7 44.6 11.4 31 21 64 60 985.95
37 31 75 8 3.26 11.9 78.4 4259 13.1 49.6 13.9 23 9 15 58 958.84
35 46 85 7.1 3.22 11.8 79.9 1441 14.8 51.2 16.1 1 1 1 54 860.1
36 30 75 7.5 3.35 11.4 81.9 4029 12.4 44 12 6 4 16 58 936.23
15 30 73 8.2 3.15 12.2 84.2 4824 4.7 53.1 12.7 17 8 28 38 871.77
31 27 74 7.2 3.44 10.8 87 4834 15.8 43.5 13.6 52 35 124 59 959.22
30 24 72 6.5 3.53 10.8 79.5 3694 13.1 33.8 12.4 11 4 11 61 941.18
31 45 85 7.3 3.22 11.4 80.7 1844 11.5 48.1 18.5 1 1 1 53 891.71
31 24 72 9 3.37 10.9 82.8 3226 5.1 45.2 12.3 5 3 10 61 871.34
42 40 77 6.1 3.45 10.4 71.8 2269 22.7 41.4 19.5 8 3 5 53 971.12
43 27 72 9 3.25 11.5 87.1 2909 7.2 51.6 9.5 7 3 10 56 887.47
46 55 84 5.6 3.35 11.4 79.7 2647 21 46.9 17.9 6 5 1 59 952.53
39 29 76 8.7 3.23 11.4 78.6 4412 15.6 46.6 13.2 13 7 33 60 968.66
35 31 81 9.2 3.1 12 78.3 3262 12.6 48.6 13.9 7 4 4 55 919.73
43 32 74 10.1 3.38 9.5 79.2 3214 2.9 43.7 12 11 7 32 54 844.05
11 53 68 9.2 2.99 12.1 90.6 4700 7.8 48.9 12.3 648 319 130 47 861.83
30 35 71 8.3 3.37 9.9 77.4 4474 13.1 42.6 17.7 38 37 193 57 989.26
50 42 82 7.3 3.49 10.4 72.5 3497 36.7 43.3 26.4 15 10 34 59 1006.5
60 67 82 10 2.98 11.5 88.6 4657 13.6 47.3 22.4 3 1 1 60 861.44
30 20 69 8.8 3.26 11.1 85.4 2934 5.8 44 9.4 33 23 125 64 929.15
25 12 73 9.2 3.28 12.1 83.1 2095 2 51.9 9.8 20 11 26 50 857.62
45 40 80 8.3 3.32 10.1 70.3 2682 21 46.1 24.1 17 14 78 56 961.01
46 30 72 10.2 3.16 11.3 83.2 3327 8.8 45.3 12.2 4 3 8 58 923.23
Not sure I'm following your logic, but it's quite obvious that 'e' (the error) should not be squared.
Let's see what you should be using.
theta is a column vector of unknowns, y is a column vector of measurements and X is the model matrix where each row is an 'example'. So you need to find theta such that:
y = X*theta
Or equivalently, use an optimization method to find theta minimizing the current squared error (this is what makes this a convex optimization problem):
e[n] = (y - X*theta[n])
e[n]^2 --> minimize
Gradient descent uses the gradient of the error function (with respect to theta) to update the theta vector:
theta[n+1] = theta[n] - alpha*2*X'*e[n]
(Note that e[n] and theta[n] are vectors. This is math notation - not matlab's)
So you see that e[n] is not squared in the update equation.

Sum and Average Data into Table from Seperate Table based on Date Intervals

I have growth data of trees for the month of June across multiple years. Around the beginning of June in 2012, 2013 and 2014, I planted seeds and went back to those seeds near the end of the month to see if the seeds germinated and the tree was alive, or didn't germinate and the tree was dead. For each sample (each seed), the number of growing days were calculated.
Sample_ID Tree_Type Check_Date Growing_Days Status Max_Temp Min_Temp Mean_Temp Total_mm_Rain
1 Spruce 25-06-2012 16 Alive
2 Spruce 28-06-2012 25 Alive
3 Fir 23-06-2012 19 Dead
4 Spruce 29-06-2012 23 Alive
5 Fir 28-06-2012 16 Alive
6 Fir 25-06-2013 18 Alive
7 Fir 26-06-2013 15 Dead
8 Spruce 28-06-2013 17 Alive
9 Fir 30-06-2013 24 Dead
10 Fir 27-06-2013 19 Alive
11 Spruce 21-06-2014 16 Alive
12 Fir 24-06-2014 18 Alive
13 Fir 28-06-2014 14 Dead
14 Spruce 29-06-2014 18 Alive
15 Spruce 30-06-2014 15 Dead
What I would like to is see how weather affected my trees. I have pulled historical weather data as a separate dataframe and would like to add to each sample row the Total_mm_Rain that fell during the growing days, along with Max, Min and Mean Temperatures of that growing period.
Date Max_Temp Min_Temp Mean_Temp Total_mm_Rain
01-05-2012 9 3 6 0
02-05-2012 9 2.5 5.8 0
03-05-2012 9.5 -2.5 3.5 4.6
04-05-2012 11 2.5 6.8 0.6
05-05-2012 10 2 6 1.8
06-05-2012 14 -2 6 0
07-05-2012 18 -2 8 0
08-05-2012 21.5 1 11.3 0
09-05-2012 17.5 4.5 11 2.8
10-05-2012 8 0.5 4.3 0
11-05-2012 14.5 -6 4.3 0
12-05-2012 19.5 -3 8.3 0
13-05-2012 23.5 -1 11.3 0
14-05-2012 25 0.5 12.8 0
15-05-2012 27.5 1.5 14.5 0
16-05-2012 24 2.5 13.3 0
17-05-2012 15.5 4.5 10 10
18-05-2012 12.5 2 7.3 0.4
19-05-2012 15 -2 6.5 0
20-05-2012 17.5 -2 7.8 0.4
21-05-2012 15.5 6.5 11 2.2
22-05-2012 12.5 8 10.3 0.4
23-05-2012 14 5 9.5 9.6
24-05-2012 10 1 5.5 1
25-05-2012 11 3 7 3
26-05-2012 13 2 7.5 0
27-05-2012 11.5 3 7.3 0
28-05-2012 17.5 3 10.3 1.2
29-05-2012 15.5 4 9.8 0.2
30-05-2012 17.6 4 10.8 0
31-05-2012 16 6.5 11.3 0.2
01-05-2013 11.5 -4.9 3.3 0
02-05-2013 17.1 -4.5 6.3 2
03-05-2013 15 5.1 10.1 0
04-05-2013 18.9 -0.2 9.4 0
05-05-2013 24.2 -1.8 11.2 0
06-05-2013 26.6 -0.1 13.3 0
07-05-2013 21.9 1.5 11.7 0
08-05-2013 24.6 4.9 14.8 0
09-05-2013 25.5 0.9 13.2 0
10-05-2013 21.4 2 11.7 0
11-05-2013 26.2 3.9 15.1 0
12-05-2013 25 4.5 14.8 0.2
13-05-2013 19.9 10.2 15.1 11
14-05-2013 13.1 5 9.1 0.2
15-05-2013 17.2 -1.7 7.8 0
16-05-2013 15.3 4.1 9.7 0
17-05-2013 18.6 2.4 10.5 1.6
18-05-2013 15.5 3 9.3 5.6
19-05-2013 12.7 5.6 9.2 1
20-05-2013 22 5 13.5 0
21-05-2013 21.9 1.9 11.9 0
22-05-2013 12 7 9.5 24.8
23-05-2013 7.3 0.1 3.7 4.6
24-05-2013 12.3 1.5 6.9 0.2
25-05-2013 13.7 3.7 8.7 0
26-05-2013 19 -1.5 8.8 0
27-05-2013 20 3.5 11.8 0
28-05-2013 17 5.5 11.3 0
29-05-2013 20.1 7 13.6 0.8
30-05-2013 13.5 7.5 10.5 2.4
31-05-2013 9.9 7 8.5 7.8
01-06-2014 8.8 -1 3.9 3.6
02-06-2014 11.4 0.5 6 0
03-06-2014 11.6 -0.7 5.5 0
04-06-2014 16.9 -3.6 6.7 0
05-06-2014 19.6 -2.3 8.7 0
06-06-2014 16.7 0.9 8.8 0
07-06-2014 9.3 5 7.2 1
08-06-2014 10.1 2.8 6.5 0.4
09-06-2014 13.3 -5.2 4.1 0
10-06-2014 16 -4.3 5.9 0
11-06-2014 17 -1.5 7.8 1.6
12-06-2014 13.9 4.7 9.3 0.3
13-06-2014 16.5 -3.4 6.6 0
14-06-2014 22.9 -2.3 10.3 0
15-06-2014 27 0.6 13.8 0
16-06-2014 29.6 4.1 16.9 0
17-06-2014 29.1 3.3 16.2 0
18-06-2014 28.1 5.6 16.9 0
19-06-2014 25.9 8.1 17 0.2
20-06-2014 15.9 8.7 12.3 3.1
21-06-2014 21.3 8.8 15.1 0.4
22-06-2014 23.7 6.7 15.2 6.9
23-06-2014 18.4 9.3 13.9 0
24-06-2014 18.2 4 11.1 6.4
25-06-2014 16 6.5 11.3 10
26-06-2014 12.2 3.6 7.9 1.9
27-06-2014 11.6 3.5 7.6 2.6
28-06-2014 13.7 4.4 9.1 5.6
29-06-2014 11.7 5.5 8.6 3.4
30-06-2014 17.4 7 12.2 0
I have tried using table functions as well as diving into the idea of converting dates to numbers (as in excel) and summing based on dates as numbers instead of dates, but this is above my knowledge of R.