How to use staty method in Molotov

Best Python code snippet using molotov_python

lekce05_dotazy.py

Source:lekce05_dotazy.py Github

copy

Full Screen

1#import wget2#wget.download("https://kodim.cz/czechitas/progr2-python/python-pro-data-1/zakladni-dotazy/assets/staty.json")3import pandas4staty = pandas.read_json("staty.json")5staty = staty.set_index("name")6print(staty[["population", "area"]])7#když dám 2 proměnné, tak jsou 2 závorky - dělám totiž ještě z toho seznam8populace = staty["population"]9#vybírám jeden sloupec, tedy jeden rozměr, je to série, není to dataframe10#když chci sečíst celou populaci, vypisuje to jako číslo11print(populace.sum())12print(staty["population"] < 1000)13#vypíše všechny státy a u toho True nebo False, jestli byla splněná podmínka14#pokud chci vypsat konkrétní státy, tak když uvidí False, tak dá pryč, pokud True, tak tam řádek nechá15# => musím to obalit do dalšího dotazu16print(staty[staty["population"] < 1000])17pidistaty = staty[staty["population"] < 1000]18print(pidistaty[["area", "population"]])19#lidnaté EV státy a podmínky (EV a víc jak 20 mil. ob), každý dotaz musí mít svou vlastní ()20# | (alt + w) je nebo; & je a zároveň21lidnate_evropske_staty = staty[(staty["population"] > 20_000_000) & (staty["region"] == "Europe")]22print(lidnate_evropske_staty)23print(lidnate_evropske_staty["population"])24vyznamne_staty = staty[(staty["population"] > 1_000_000_000) | (staty["area"] > 3_000_000)]25print(vyznamne_staty)26#podmínka na seznam regionů27zap_vych_evropa = staty[staty["subregion"].isin(["Western Europe", "Eastern Europe"])]...

Full Screen

Full Screen

pro_data_1_zakladni_dotazy.py

Source:pro_data_1_zakladni_dotazy.py Github

copy

Full Screen

1import pandas2import wget3#wget.download("https://kodim.cz/czechitas/progr2-python/python-pro-data-1/zakladni-dotazy/assets/staty.json")4staty = pandas.read_json("staty.json")5staty = staty.set_index("name")6#print(staty.info())7#print(staty.loc["Czech Republic":"Dominican Republic"])8#print(staty.loc["Uzbekistan":])9#print(staty.loc[["Czech Republic", "Slovakia"], "capital"])10#print(staty["population"])11#print(staty[["population", "area"]])12#populace = staty["population"]13#print(populace.sum())14#print(staty["population"] < 1000) // printuje False a True, nevymenuje staty15#pidistaty = staty[staty["population"] < 1000]16#print(pidistaty[["area", "population"]])17lidnate_evropske_staty = staty[(staty["population"] > 20_000_000) & (staty["region"] == "Europe")]18#print(lidnate_evropske_staty["population"])19vyznamne_staty = staty[(staty["population"] > 1_000_000_000) | (staty["area"] > 3_000_000)]20#print(vyznamne_staty[["population", "area"]])21zap_vych_evropa = staty[staty["subregion"].isin(["Western Europe", "Eastern Europe"])]...

Full Screen

Full Screen

zakladnidotazy.py

Source:zakladnidotazy.py Github

copy

Full Screen

1import pandas2# import wget3# wget.download("https://kodim.cz/czechitas/progr2-python/python-pro-data-1/zakladni-dotazy/assets/staty.json")4#5staty = pandas.read_json("staty.json")6staty = staty.set_index("name")7#8#print(staty.info())9#print(staty.index)10#11# print (staty.loc["Czech Republic"]) #loc bude vypisovat radky ktere jsme si pojmenovali v set_index name12#13#print (staty.loc["Czech Republic":"Dominican Republic"]) #vypise vsechno od CZ po Dom, vcetne, to je jinak nez u ILOC, ktery posledni cislo nebere v potaz14#15#print (staty.loc["Czech Republic":])#od ceksa dal16# print (staty.loc[["Slovakia", "Austria", "Poland"], ["gini", "population"]]) #vybere zeme a sloupecky co ma vybrat17# populace = staty["population"]18# print(populace.sum())19#20# pidistaty = staty[staty["population"] < 1000]21# print(pidistaty[["area", "population"]])22lidnate_evropske_staty = staty [(staty["population"] > 20000000) & (staty["region"] == "Europe")]...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Molotov automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful