def dataset_insert_manual(dataset): id=int(input("Введіть ID:")) neighbourhood=input("Введіть значення для neighbourhood:") state=input("Введіть значення для state:") market=input("Введіть значення для market:") country=input("Введіть значення для country:") dataset.update([(id,dict([("neighbourhood",neighbourhood),("state",state),("market",market),("country",country)]))])
def insert(dataset, year, horz_plant, vert_wall, sidw_raise): dataset.update({ year: { "horz_plant": horz_plant, "vert_wall": vert_wall, "sidw_raise": sidw_raise } }) return dataset
def dataset_insert_manual(dataset, host_id, room_type, bedrooms, country): conditions = [ room_type_validator(room_type), bedrooms_validator(bedrooms), host_id_validator(host_id), country_validator(country) ] if all(conditions): dataset.update({ host_id: { "room_type": room_type, "bedrooms": bedrooms, "country": country } })
from dataset_structure import dataset new_flight = { 7777777: { "neighbourhood": "Meninghton", "state": "WA", "market": "Seattle", "country": "United States" } } dataset.update(new_flight) print(dataset)
from dataset_structure import dataset dataset.update( { "1001104":{ "price" : "$500.0", "minimum_nights" : "1", "weekly_price" : "$1000.0" } } ) print(dataset)
def dataset_insert(dataset, provider_id, data, keys_list): new_data = dict(zip(keys_list, data)) dataset.update({provider_id: new_data})