--- language: - en - zh pretty_name: GeoComp tags: - GeoLocation size_categories: - 10M 'lastRoundResult' if 'player' in game_data and 'lastRoundResult' in game_data['player']: last_round_result = game_data['player']['lastRoundResult'] guess_place = last_round_result.get('guessPlace') target_place = last_round_result.get('targetPlace') score = last_round_result.get('score') # Extract panoId from the first element of the 'rounds' list if 'rounds' in game_data and len(game_data['rounds']) > 0: first_round = game_data['rounds'][0] pano_id = first_round.get('panoId') return guess_place, target_place, score, pano_id except json.JSONDecodeError: print(f"Error decoding JSON for row: {data_json_str[:100]}...") # Print first 100 chars for context return None, None, None, None except KeyError as e: print(f"Missing key: {e} in row: {data_json_str[:100]}...") # Print first 100 chars for context return None, None, None, None # Apply the function to the 'data' column and create new columns in the DataFrame df[['guessPlace', 'targetPlace', 'score', 'panoId']] = df['data'].apply( lambda x: pd.Series(extract_game_details(x)) ) # Display the first few rows with the newly extracted columns print(df[['id', 'guessPlace', 'targetPlace', 'score', 'panoId']].head()) ``` ## Additional Information We will release citation information and links after double-blind review.