Python Forum
How many times does it fit? help please
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How many times does it fit? help please
#2
Solved, left the code here if someone would like to see it
Grande=Big
Chica=Small
Filas=Rows
Columnas=Columns
Entra=Fits
Veces=Times
maybe those few word translations will be useful :)
import numpy as np
nGrande = 8
matrizGrande = np.zeros((nGrande,nGrande))
for i in range(1,matrizGrande.shape[0]+1):
    matrizChica = np.zeros((i,i))
    filasMatriz = matrizChica.shape[0]
    columnasMatriz = matrizChica.shape[1]
    entra = matrizGrande.shape[0]//filasMatriz * matrizGrande.shape[0]//columnasMatriz
    print("La Matriz de",str(i)+"x"+str(i)+" entra",entra, "veces en la matriz de",str(matrizGrande.shape[0])+"x"+str(matrizGrande.shape[0]))
Reply


Messages In This Thread
How many times does it fit? help please - by skriff - Sep-11-2017, 01:06 PM
RE: How many times does it fit? help please - by skriff - Sep-11-2017, 06:32 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Find how many times a user played an artist and how many times disruptfwd8 1 2,651 May-04-2018, 08:32 AM
Last Post: killerrex

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020