1

I'm teaching a kid mathematics and programming with the chess-rice story,(you know, that one that the king pays with rice to the guy that invented chess), using python and jupyter notebook, the thing is I need to display a table with columns i, and 2**i with i from 0 to 64, but when I get to 64 the size of the number is too big for a numpy array, here is the code

from numpy import *
import pandas as pd
pd.set_option('display.max_rows', 500)
pd.set_option('display.max_columns', 500)
pd.set_option('display.width', 1000)

casilla = arange(1,65,1)
arroz = power(2,casilla)
casilla_arroz = pd.DataFrame(arroz,columns = ['Numero de granos de arroz'], index = casilla)
casilla_arroz.index.name = 'Numero de casilla'

display(casilla_arroz) 

Any fix for this?

1 Answers1

0

casilla = arange(1,65,1, dtype='object') solves the issue