lt=[[['Volvo', 'Xc90', '2017', 'Gray', '2.0L'],
'YV4102XK8H1144180', 'Copart', '69990071',
'Run And Drive', 'Side', '33554 мили (Actual)', '07.02.2022'],
[['Volvo', 'Xc90', '2017', 'Gray', '2.0L'],
'YV4102XK8H1144180', 'Copart', '69990071',
'Run And Drive', 'Side', '33554 мили (Actual)', '07.02.2022'],
[['Volvo', 'Xc90', '2017', 'Gray', '2.0L'],
'YV4102XK8H1144180', 'Copart', '69990071',
'Run And Drive', 'Side', '33554 мили (Actual)', '07.02.2022']]
def fl_list(l):
# print(l)
fl=[]
for sl in l:
if type(sl)!=list:
fl.append(sl)
else:
fl=fl+fl_list(sl)
return fl
flt=[]
for li in lt:
flt.append(fl_list(li))
print(flt)
[['Volvo', 'Xc90', '2017', 'Gray', '2.0L', 'YV4102XK8H1144180', 'Copart', '69990071', 'Run And Drive', 'Side', '33554 мили (Actual)', '07.02.2022'],
['Volvo', 'Xc90', '2017', 'Gray', '2.0L', 'YV4102XK8H1144180', 'Copart', '69990071', 'Run And Drive', 'Side', '33554 мили (Actual)', '07.02.2022'],
['Volvo', 'Xc90', '2017', 'Gray', '2.0L', 'YV4102XK8H1144180', 'Copart', '69990071', 'Run And Drive', 'Side', '33554 мили (Actual)', '07.02.2022']]
import matplotlib.pyplot as plt
DAYS = 7
dates, messages = ["08.01","09.01","10.01","11.01","12.01","13.01","14.01"], [75,30,225,6,100,1234,567]
step = round(sum(messages)/DAYS)
steps = range(0, step*DAYS, step)
extent = [0, max(steps), 0, max(messages)]
# img = plt.imread("background.jpg")
_, ax = plt.subplots()
# ax.imshow(img, extent=extent)
ax.plot(dates, messages)
plt.xticks(dates)
plt.title("Активность")
plt.show()