data_csv_read[2]
data_csv_read[i][password_plus]
for i in range(games_len):
game_plus = int(0)
login_plus = int(1)
password_plus = int(2)
..........
game_plus += 1
login_plus += 1
password_plus += 1
data_csv_read = ""
data_csv_read.append((game_csv, login_csv, password_csv))
lt=[['Volvo', 'Xc90', '2017', 'Gray',['A','B','C','D'], '2.0L'], 'YV4102XK8H1144180', 'Copart',
'69990071', 'Run And Drive', 'Side', '33554 мили (Actual)',
['Volvo', 'Xc90', '2017', 'Gray', '2.0L'],'07.02.2022']
def fl_list(l):
fl=[]
for sl in l:
if type(sl)!=list:
fl.append(sl)
else:
fl=fl+fl_list(sl)
return fl
flt=fl_list(lt)
print(flt)
['Volvo', 'Xc90', '2017', 'Gray', 'A', 'B', 'C', 'D', '2.0L', 'YV4102XK8H1144180', 'Copart', '69990071', 'Run And Drive', 'Side', '33554 мили (Actual)', 'Volvo', 'Xc90', '2017', 'Gray', '2.0L', '07.02.2022']
[[('rq', 'rq', 178.0, -8.0), ('ty', 'ty', 189.0, -4.0)],
[('rt', 'rt', 190.0, -3.0), ('my', 'my', 170.0, -0.3)],
[('js', 'js', 179.0, 0.3), ('a ', 'a ', 156.0, 0.4)],
[('ra', 'ra', 156.0, 0.8), ('mm ', 'mm', 180.0, 1.0)]]
[[('rq', 'rq'), ('ty', 'ty')],
[('rt', 'rt'), ('my', 'my')],
[('js', 'js'), ('a ', 'a ')],
[('ra', 'ra'), ('mm ', 'mm')]]
it=[[('rq', 'rq', 178.0, -8.0), ('ty', 'ty', 189.0, -4.0)],
[('rt', 'rt', 190.0, -3.0), ('my', 'my', 170.0, -0.3)],
[('js', 'js', 179.0, 0.3), ('a ', 'a ', 156.0, 0.4)],
[('ra', 'ra', 156.0, 0.8), ('mm ', 'mm', 180.0, 1.0)]]
print(it)
ot=[]
for el in it:
ot.append([el[0][0:2],el[1][0:2]])
print(ot)
ts = ['1 ядро: 50 s',
'2 ядро: 43 s',
'3 ядро: 55 s']
for ln in ts:
print(ln, end="\r")
import time
ts = ['1 ядро: 50 s',
'2 ядро: 43 s',
'3 ядро: 55 s',
'4 ядро 88 s']
print(ts[0])
print(ts[1])
time.sleep(3)
print("\033[H\033[J ")
print(ts[2])
print(ts[3])
time.sleep(3)
print("\033[H\033[J ")
print(ts[0])
print(ts[1])
ex='создать чат бота'
ex_set=set(ex.split(' '))
sent="Добрый день, Требуется создать телеграм бота для размещения объявлений"
sent_set=set(sent.split(' '))
print(1-len(sent_set.difference(ex_set))/len(sent_set))
0.2222222222222222
import timeit
measurements = timeit.repeat('for i in [1,2,3,4,5]: pass', number=1000000)
print(measurements)
[0.09542479999998932, 0.07413599999995313, 0.08125240000003942, 0.07413070000001198, 0.08504640000001018]
import timeit
measurements = timeit.repeat('for i in [item for item in [1,2,3,4,5]]: pass', number=1000000)
print(measurements)
[0.3339560999999662, 0.4172341999999958, 0.42956249999997453, 0.37294059999999263, 0.3278073999999833]
import datetime as dt
import pandas as pd
date = dt.date.today() + pd.offsets.DateOffset(months=6)
print(date)
2022-07-20 00:00:00
date = dt.date.today() + pd.offsets.DateOffset(years=1)
print(date)
2023-01-20 00:00:00
date = dt.date.today() + pd.offsets.DateOffset(years=1,months=3)
print(date)
2023-04-20 00:00:00
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.dates import DateFormatter
dt=['2022-01-07 Пт', '2022-01-08 Сб', '2022-01-09 Вс', '2022-01-10 Пн', '2022-01-11 Вт', '2022-01-12 Ср', '2022-01-13 Чт', '2022-01-14 Пт', '2022-01-15 Сб', '2022-01-16 Вс', '2022-01-17 Пн']
['04:08:42', '02:14:29', '02:11:29', '02:35:51', '02:50:42', '02:34:17', '02:29:04', '03:05:52', '02:43:35', '02:10:27', '04:17:31']
dur=['04:08:42', '02:14:29', '02:11:29', '02:35:51', '02:50:42', '02:34:17', '02:29:04', '03:05:52', '02:43:35', '02:10:27', '04:17:31']
df = pd.DataFrame({'Date':dt,
'Dur': dur})
df['Dur'] = pd.to_timedelta(df['Dur'])
df['Dur'] = pd.to_datetime(df['Dur'].values.astype('datetime64[D]'))
fig, ax = plt.subplots()
myFmt = DateFormatter("%H:%M:%S")
ax.yaxis.set_major_formatter(myFmt)
ax.plot(df['Date'], df['Dur'])
import datetime
import matplotlib.pyplot as plt
from matplotlib.dates import DateFormatter
dt=['2022-01-07 Пт', '2022-01-08 Сб', '2022-01-09 Вс', '2022-01-10 Пн', '2022-01-11 Вт', '2022-01-12 Ср', '2022-01-13 Чт', '2022-01-14 Пт', '2022-01-15 Сб', '2022-01-16 Вс', '2022-01-17 Пн']
['04:08:42', '02:14:29', '02:11:29', '02:35:51', '02:50:42', '02:34:17', '02:29:04', '03:05:52', '02:43:35', '02:10:27', '04:17:31']
dur=['04:08:42', '02:14:29', '02:11:29', '02:35:51', '02:50:42', '02:34:17', '02:29:04', '03:05:52', '02:43:35', '02:10:27', '04:17:31']
dlt=[]
for dr in dur:
dlt.append(datetime.datetime.strptime(dr,"%H:%M:%S"))
fig, ax = plt.subplots()
myFmt = DateFormatter("%H:%M:%S")
ax.yaxis.set_major_formatter(myFmt)
ax.plot(dt, dlt)