It might be easier to pull the data in with a simpler query
SELECT DATEPART(YEAR), DATEPART(WEEK), MAX(col_1), MAX(col_2), etc
FROM ICE_PAC
WHERE t_stamp >= date_beg and t_stamp <= date_end
GROUP BY YEAR, WEEK
ORDER BY YEAR, WEEK
Then use a python script to perform the pivot.
Pivots take 3 columns of data and turn them into a matrix with one column forming the matrix column headings (week), another being the row labels (machine), and another filling the cells according to the aggregation. Your columns should be YYYY-WW, machine name, value. Since your data is in 50 columns (WASA, CUB, AQF, etc.) a UNION could be used to create the SourceTable (syntax is not perfect):
SELECT 'WASA' as machine, CAST(DATEPART(YEAR, t_stamp) AS VARCHAR) + '-' + CAST(DATEPART(WEEK, t_stamp) AS VARCHAR)
, MAX(WASA) AS v_float
UNION
SELECT 'CUB' as machine, CAST(DATEPART(YEAR, t_stamp) AS VARCHAR) + '-' + CAST(DATEPART(WEEK, t_stamp) AS VARCHAR)
, MAX(CUB) AS v_float
UNION
SELECT 'AQF' as machine, CAST(DATEPART(YEAR, t_stamp) AS VARCHAR) + '-' + CAST(DATEPART(WEEK, t_stamp) AS VARCHAR)
, MAX(AQF) AS v_float
WHERE t_stamp >= @date_beg and t_stamp <= @date_end
GROUP BY DATEPART(YEAR, t_stamp), DATEPART(WEEK, t_stamp)
ORDER BY DATEPART(YEAR, t_stamp), DATEPART(WEEK, t_stamp)
ETC, ETC, ETC (for all 50 machines)
Then all you need is to create the YEAR and WEEK range for use in the outer SELECT and the IN clause.