In [4]:
import pyspark.sql.functions as F
In [3]:
restaurants_df = spark.read.json('../data/restaurants')
In [10]:
restaurants_df.filter(restaurants_df['name'] == 'Sweets Raku').collect()
Out[10]:
[Row(address='5040 W Spring Mountain Rd, Ste 3', attributes=['Alcohol: beer_and_wine', "Ambience: {'romantic': False, 'intimate': False, 'classy': False, 'hipster': False, 'divey': False, 'touristy': False, 'trendy': True, 'upscale': False, 'casual': False}", "BestNights: {'monday': False, 'tuesday': True, 'friday': True, 'wednesday': False, 'thursday': False, 'sunday': False, 'saturday': True}", 'BikeParking: True', 'BusinessAcceptsCreditCards: True', "BusinessParking: {'garage': False, 'street': False, 'validated': False, 'lot': True, 'valet': False}", 'Caters: False', 'CoatCheck: False', 'GoodForDancing: False', "GoodForMeal: {'dessert': True, 'latenight': False, 'lunch': False, 'dinner': False, 'breakfast': False, 'brunch': False}", 'HappyHour: False', 'HasTV: False', "Music: {'dj': False, 'background_music': False, 'no_music': False, 'karaoke': False, 'live': False, 'video': False, 'jukebox': False}", 'NoiseLevel: average', 'OutdoorSeating: False', 'RestaurantsDelivery: False', 'RestaurantsGoodForGroups: False', 'RestaurantsPriceRange2: 2', 'RestaurantsReservations: False', 'RestaurantsTakeOut: False', 'Smoking: no', 'WheelchairAccessible: True'], business_id='umXvdus9LbC6oxtLdXelFQ', categories=['Desserts', 'American (Traditional)', 'Bars', 'Food', 'Nightlife', 'Wine Bars', 'Restaurants'], city='Las Vegas', hours=['Monday 18:0-0:0', 'Tuesday 18:0-0:0', 'Wednesday 18:0-3:0', 'Thursday 18:0-0:0', 'Friday 18:0-0:0', 'Saturday 12:0-0:0', 'Sunday 12:0-21:0'], is_open=1, latitude=36.1264269463, longitude=-115.209914042, name='Sweets Raku', neighborhood='Chinatown', postal_code='89146', review_count=627, stars=4.5, state='NV', type='business')]
In [ ]:
Content source: samleegithub/RestaurantRecs
Similar notebooks: