mardi 11 octobre 2022

Random function keeps generating a dtype

I'm trying to create a function that generates a dictionary. Dictionary will contain inputs element1 = user will decide input & element2 = is a rng.integers(low, high, size = 50). If I simulate code below, it will return the dictionary + dtype=64.

Question: How do I remove dtype=64, when I would like to keep it as an array?

emptydictionary = {}

element2 = rng.integers(low, high, size = 50)
element1 = randomnumber

def function(element1,element2):
    emptydictionary.update({element1:element2})
    return emptydictionary

function(element1,element2)



Aucun commentaire:

Enregistrer un commentaire