if filtered_objects_profits[index] # допишите новое условие
если значение filtered_objects_profits[index] больше 500000
import pandas as pd
d1 = {"A": ["TRUE", "FALSE", "FALSE", "TRUE"],
"B": ["0.78", "0.35", "0.14", "0.99"]}
d2 = {"C": [1, 0, 1, 1],
"D": [1.52, 1.22, 2.64, 3.63]}
df1 = pd.DataFrame(d1)
df2 = pd.DataFrame(d2)
print("********\n", df1)
print("********\n", df2)
df3 = pd.concat([df1, df2], axis=1)
print("********\n", df3)
# CSV
df3.to_csv('/tmp/out.csv', index=True)
# напечатает:
********
A B
0 TRUE 0.78
1 FALSE 0.35
2 FALSE 0.14
3 TRUE 0.99
********
C D
0 1 1.52
1 0 1.22
2 1 2.64
3 1 3.63
********
A B C D
0 TRUE 0.78 1 1.52
1 FALSE 0.35 0 1.22
2 FALSE 0.14 1 2.64
3 TRUE 0.99 1 3.63
# файл:
$ cat out.csv
,A,B,C,D
0,TRUE,0.78,1,1.52
1,FALSE,0.35,0,1.22
2,FALSE,0.14,1,2.64
3,TRUE,0.99,1,3.63
#include <iostream>
#include <map>
int main()
{
using namespace std::string_literals;
auto m = std::map<int,std::string>{
{1,"гриб"s},
{2,"гриба"s},
{3,"грибов"s},
};
auto txt = "гриб"s;
auto k = int{};
std::cin >> k;
auto k10 = k % 10;
auto k100 = k % 100;
if (k100 == 0) txt = m.at(3);
else if (k100 == 1) txt = m.at(1);
else if (k100 < 5) txt = m.at(2);
else txt = m.at(3);
if (k100 > 20)
{
if (k10 == 0) txt = m.at(3);
else if (k10 == 1) txt = m.at(1);
else if (k10 < 5) txt = m.at(2);
else txt = m.at(3);
}
std::cout << "Мы нашли " << k << " " << txt << '\n';
}
#include <random>
#include <iostream>
int GetRandomNumber(int min, int max)
{
auto rnd = std::random_device{};
auto gen = std::mt19937_64{rnd()};
auto dis = std::uniform_int_distribution<int>{min, max};
return dis(gen);
}
int main()
{
auto number = GetRandomNumber(0, 20);
std::cout << "number = " << number << '\n';
}
$ yt-dlp --flat-playlist --print filename -o "%(id)s" https://www.youtube.com/c/EricRosenClips/videos 2>/dev/null
iyxjf56kOqk
yeazPGMxeso
cSznqBAtrEc
...
i0orFldjhXM
5zfWLcwUsIM
OtgT0d9XhC0
import json
with open("ваш_файл.json") as f:
content = f.read()
for module in json.loads(content)["module"]:
detail_lists = module["detailList"]
for dl in detail_lists:
print(dl["standerdDesc"])
# напечатает:
[Fenggang Town] Processing at sorting center
Received by logistics company
rows_N = int(input("Введите количество строк N (N>=1): "))
if rows_N >= 1:
column_K = int(input("Введите количество столбцов K (K>=3): "))
if column_K >= 3:
mas = [[0 for j in range(column_K)] for i in range(rows_N)]
k = 0
n = 0
for k in range(1, column_K + 1):
for n in range(1, rows_N + 1):
if k == 1:
x = 1
else:
x = int(1 / 2 * k * (n**2 - n) - n**2 + 2 * n)
mas[n - 1][k - 1] = x
for row in mas:
print(", ".join([f"{x:>4}" for x in row]))
Введите количество строк N (N>=1): 15
Введите количество столбцов K (K>=3): 10
1, 1, 1, 1, 1, 1, 1, 1, 1, 1
1, 2, 3, 4, 5, 6, 7, 8, 9, 10
1, 3, 6, 9, 12, 15, 18, 21, 24, 27
1, 4, 10, 16, 22, 28, 34, 40, 46, 52
1, 5, 15, 25, 35, 45, 55, 65, 75, 85
1, 6, 21, 36, 51, 66, 81, 96, 111, 126
1, 7, 28, 49, 70, 91, 112, 133, 154, 175
1, 8, 36, 64, 92, 120, 148, 176, 204, 232
1, 9, 45, 81, 117, 153, 189, 225, 261, 297
1, 10, 55, 100, 145, 190, 235, 280, 325, 370
1, 11, 66, 121, 176, 231, 286, 341, 396, 451
1, 12, 78, 144, 210, 276, 342, 408, 474, 540
1, 13, 91, 169, 247, 325, 403, 481, 559, 637
1, 14, 105, 196, 287, 378, 469, 560, 651, 742
1, 15, 120, 225, 330, 435, 540, 645, 750, 855