Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- import pandas as pd
- # 5x5 matrix in range(1, 100) with args
- random_matrix = np.random.randint(1, 100, (5, 5))
- # 5x5 matrix in range(1, 100) with kwargs
- rand_matrix = np.random.randint(low=1, high=100, size=(5,5))
- # 5x5 matrix with long float values
- rand_matrix = np.random.rand(5, 5)
- # transform numpy matrix to pandas DataFrame
- df_rand_matrix = pd.DataFrame(np.random.randint(low=0, high=10, size=(7, 7)), columns=[x for x in range(7)])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement