Created
July 10, 2020 12:18
-
-
Save Nagasaki45/aaf6927c416f276bc2c05ec1488d6cd1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
original_data = [ | |
{'globalTime': 1795, 'istTime': [0, 23, 39], 'coordinates': [(173, 289), (171, 289), (170, 289)]}, | |
{'globalTime': 1714, 'istTime': [0, 18, 36], 'coordinates': [(137, 429), (133, 433), (130, 436)]}, | |
] | |
transformed_data = [ | |
{'globalTime': row['globalTime'], 'istTime': it, 'x': x, 'y': y} | |
for row in original_data | |
for it, (x, y) in zip(row['istTime'], row['coordinates']) | |
] | |
df = pd.DataFrame(transformed_data) | |
print(df) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment