Mar-06-2019, 01:34 PM
Hi,
I have below code, and I want to get(calculate) the memory usage and execution time of each line of my code. My code is below, kindly someone help,
I have below code, and I want to get(calculate) the memory usage and execution time of each line of my code. My code is below, kindly someone help,
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns; sns. set () uniform_data = np.random.rand( 10 , 12 ) ax = sns.heatmap(uniform_data, cbar_kws = { 'ticks' : [ 0 , 2 , 4 , 6 , 8 , 10 ]}, vmin = 0 , vmax = 10 ) plt.show() #Create a DataFrame d = { 'Name' :[ 'Alisa' , 'Bobby' , 'Cathrine' , 'Madonna' , 'Rocky' , 'Sebastian' , 'Jaqluine' , 'Rahul' , 'David' , 'Andrew' , 'Ajay' , 'Teresa' ], 'Score1' :[ 62 , 47 , 55 , 74 , 31 , 77 , 85 , 63 , 42 , 32 , 71 , 57 ], 'Score2' :[ 89 , 87 , 67 , 55 , 47 , 72 , 76 , 79 , 44 , 92 , 99 , 69 ]} df = pd.DataFrame(d) col_mean = df.mean() col_std = df.std() get_disc = df.describe() |