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';
}
#include <iostream>
#include <fstream>
#include <array>
#include <vector>
using Four = std::array<float, 4>;
struct Image
{
std::array<Four, 2> VertexCoordinats;
unsigned int IndexTexture;
std::string Name;
int number;
};
int main()
{
auto fin = std::ifstream{"welcome coordinats.txt"};
auto images = std::vector<Image>{};
if (fin.is_open())
{
auto im = Image{};
while ( (fin >> im.Name)
&& (fin >> im.VertexCoordinats[0][0])
&& (fin >> im.VertexCoordinats[0][1])
&& (fin >> im.VertexCoordinats[0][2])
&& (fin >> im.VertexCoordinats[0][3]))
{
images.push_back(im);
}
}
for (const auto& im : images)
{
std::cout << im.Name << '\n';
for (const auto& e : im.VertexCoordinats[0])
{
std::cout << e << ", ";
}
std::cout << std::endl;
}
fin.close();
}
# печатает
content//welcome.jpg
1, -1, 1, -1,
content//logo.png
0.8, -0.8, 0.8, 0.4,
$ 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