Created
August 10, 2021 05:00
-
-
Save LauraLangdon/4a75924ddc67bbe28b185976bc810ca9 to your computer and use it in GitHub Desktop.
This file contains 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
def randomize_vectors(tweet_vectors): | |
""" | |
:param tweet_vectors: | |
:return: randomized_tweet_vectors: a Numpy array of tweet vectors that have | |
been randomly shuffled | |
""" | |
#Initialize randomized tweet vectors | |
randomized_tweet_vectors = np.zeros((tweet_vectors.shape[0], tweet_vectors.shape[1]), dtype=int) | |
for x in range(tweet_vectors.shape[0]): | |
for y in range(tweet_vectors.shape[1]): | |
randomized_tweet_vectors[x][y] = tweet_vectors[x][y] | |
np.random.shuffle(randomized_tweet_vectors) | |
return randomized_tweet_vectors |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment