Month: September 2020
How to check a function profile in detail using profiler
profiling and timing code: link %load_ext line_profilerpredicted = predict(pandas_df) #put the function to get profile from%prun predict(pandas_df)
How to test running time of a function
import time start_time = time.time()predicted = class.predict(pandas_df) #this include the function to testprint((time.time() – start_time))
How to rename columns for pandas dataframe
rename a pandas dataframe with names from ‘0’ to ‘100’: pd_data_frame.columns = [str(_) for _ in range(99)]