text_plain_output_1.png
import json

import numpy as np

import os

import pandas as pd

import numpy as np
import pandas as pd
import json
import os
source_list = set()
for dirname, _, filenames in os.walk('/kaggle/input'):
    for filename in filenames:
        with open(str(os.path.join(dirname, filename)), 'r') as file:
            json_file = json.load(file)
            for record in json_file:
                source_list.add(record)
df_dictionary = {}
for record in source_list:
    df_dictionary[record] = []
for dirname, _, filenames in os.walk('/kaggle/input'):
    for filename in filenames:
        name = filename.split('.')
        city = name[0]
        with open(str(os.path.join(dirname, filename)), 'r') as file:
            json_file = json.load(file)
            for source in json_file:
                temp_df = pd.DataFrame(json_file[source])
                temp_df['city'] = city
                df_dictionary[source].append(temp_df)
for df in df_dictionary:
    result = pd.concat(df_dictionary[df])
    df_dictionary[df] = result
airbnbHotels = df_dictionary['airbnbHotels']
bookingHotels = df_dictionary['bookingHotels']
hotelsComHotels = df_dictionary['hotelsComHotels']

L = bookingHotels['price'].apply(lambda x: x['value'])
print(np.mean(L))