马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
数据:
"data":[["2022-12-02",2383.32,2408.74,2378.40,2369.31,2383.32,2.14,"0.09%",460.73,1260.83,null],["2022-12-01",2381.18,2403.77,2386.08,2380.67,2381.18,35.87,"1.53%",689.54,1763.01,null],["2022-11-30",2345.31,2348.16,2335.95,2323.19,2345.31,5.52,"0.24%",503.28,1320.09,null],["2022-11-29",2339.79,2347.71,2301.21,2298.31,2339.79,40.99,"1.78%",545.52,1581.91,null],["2022-11-28",2298.80,2300.95,2264.83,2261.05,2298.80,-10.56,"-0.46%",400.68,1126.00,null],["2022-11-25",2309.36,2327.28,2325.57,2304.98,2309.36,-26.16,"-1.12%",348.98,947.76,null],["2022-11-24",2335.52,2356.67,2349.27,2330.37,2335.52,-4.82,"-0.21%",385.33,996.35,null],["2022-11-08",2432.40,2460.99,2452.86,2411.72,2432.40,-22.29,"-0.91%",530.44,1345.00,null],["2022-11-07",2454.69,2470.64,2447.13,2432.05,2454.69,3.47,"0.14%",638.18,1656.64,null]]
想提取每个日期及对应的第二个和第四个数据,如第一个为:"2022-12-02",2408.74,2369.31 ....
求大师帮忙指点下
data = [["2022-12-02",2383.32,2408.74,2378.40,2369.31,2383.32,2.14,"0.09%",460.73,1260.83,"null"],["2022-12-01",2381.18,2403.77,2386.08,2380.67,2381.18,35.87,"1.53%",689.54,1763.01,"null"],["2022-11-30",2345.31,2348.16,2335.95,2323.19,2345.31,5.52,"0.24%",503.28,1320.09,"null"],["2022-11-29",2339.79,2347.71,2301.21,2298.31,2339.79,40.99,"1.78%",545.52,1581.91,"null"],["2022-11-28",2298.80,2300.95,2264.83,2261.05,2298.80,-10.56,"-0.46%",400.68,1126.00,"null"],["2022-11-25",2309.36,2327.28,2325.57,2304.98,2309.36,-26.16,"-1.12%",348.98,947.76,"null"],["2022-11-24",2335.52,2356.67,2349.27,2330.37,2335.52,-4.82,"-0.21%",385.33,996.35,"null"],["2022-11-08",2432.40,2460.99,2452.86,2411.72,2432.40,-22.29,"-0.91%",530.44,1345.00,"null"],["2022-11-07",2454.69,2470.64,2447.13,2432.05,2454.69,3.47,"0.14%",638.18,1656.64,"null"]]
result = []
for each in data:
result.append((each[0], each[2], each[4]))
print(result)
[('2022-12-02', 2408.74, 2369.31), ('2022-12-01', 2403.77, 2380.67), ('2022-11-30', 2348.16, 2323.19), ('2022-11-29', 2347.71, 2298.31), ('2022-11-28', 2300.95, 2261.05), ('2022-11-25', 2327.28, 2304.98), ('2022-11-24', 2356.67, 2330.37), ('2022-11-08', 2460.99, 2411.72), ('2022-11-07', 2470.64, 2432.05)]
|