This file contains hidden or 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
import numpy as np | |
a = np.random.uniform(0,1,10000000) | |
print(type(a)) | |
b = a.tolist() | |
print(type(b)) | |
c = tuple(b) | |
print(type(c)) | |
%%timeit |
This file contains hidden or 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
import pandas as pd | |
import numpy as np | |
num_users = 10 | |
num_items = 5 | |
np.random.seed(42) | |
def generate_users(num_users, num_items): | |
data = [] | |
for i in range(num_users): | |
user = [np.random.randint(2) for _ in range(num_items)] |
This file contains hidden or 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
try: | |
import pyaudio | |
import numpy as np | |
import pylab | |
import matplotlib.pyplot as plt | |
from scipy.io import wavfile | |
import time | |
import sys | |
import seaborn as sns | |
except: |