Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pandas as pd
- import numpy as np
- nombre = ['Oliva', 'Daniela', 'Juan', 'Germán', 'Edward', 'Alex', 'Julio',
- 'Edgar', 'Angie', 'Irlesa']
- puntaje = [11.5, 8, 15.5, np.nan, 8, 19, 13.5, np.nan, 8, 18]
- intentos = [1, 3, 2, 3, 2, 3, 1, 1, 2, 1]
- califico = ['Sí', 'No', 'Sí', 'No', 'No', 'Sí', 'Sí', 'No', 'No', 'Sí']
- indices = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']
- jugadores = {'nombre': nombre, 'puntaje': puntaje, 'intentos': intentos,
- 'califico': califico}
- df = pd.DataFrame(data=jugadores, index=indices)
- with open('output.json', 'w', encoding='utf-8') as f:
- df.to_json(f, force_ascii=False)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement