# coding: utf -8-*-
# Time: 2019/12/31 10:03
import time
import pandas as pd
# import os
# os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
start = time.clock()
start2 = time.time()
import datetime
start3 = datetime.datetime.now()
import timeit
start4 = timeit.default_timer()
train_data = pd.read_csv("./train.csv")
X = train_data.drop(columns=["Flow"])
Y = train_data["Flow"]
print(type(X))
print(type(Y))
end = time.clock()
print('只计算cpu执行时间 cpu running time: %s seconds' % (end - start))
end2 = time.time()
print('程序的执行时间 program running time: %s seconds' % (end2 - start2))
end3 = datetime.datetime.now()
print('程序的执行时间 program running time: %s seconds' % (end3 - start3))
end4 = timeit.default_timer()
print('程序的执行时间 program running time: %s seconds' % (end4 - start4))
# 时间计算建议在unix/linux系统中使用time.time();windows系统中使用time.clock();跨平台timeit.default_timer()
<class ‘pandas.core.frame.DataFrame’>
<class ‘pandas.core.series.Series’>
只计算cpu执行时间 cpu running time: 0.0221142 seconds
程序的执行时间 program running time: 0.022938966751098633 seconds
程序的执行时间 program running time: 0:00:00.022939 seconds
程序的执行时间 program running time: 0.022132600000000002 seconds
Process finished with exit code 0