import numpy as np
import pandas as pd
Copy the code

[Task 4] Graphics card logs

The following describes the performance evaluation log results of the 3090 graphics card. Each log has the following structure:

Benchmarking #2# #4# precision type #1#
#1#  model average #2# time :  #3# ms
Copy the code

#2# : train(ing); #3# : time consuming; #4# : inference;

Benchmarking Inference Float Precision Type RESnet50 Resnet50 Model Average Inference Time: 13.426570892333984 MSCopy the code

Please arrange the log result and transform it into the following state, model_I is filled with the corresponding model name, sorted in alphabetical order, and the value is kept as three decimal places:

Train_half Train_float Train_double Inference_half Inference_float Inference_double
model_1 0.954 0.901 0.357 0.281 0.978 1.130
model_2 0.360 0.794 0.011 1.083 1.137 0.394

Data download links: 】 pan.baidu.com/s/1CjfdtavE… Extraction code: 4MUI

df = pd.read_table('practice/benchmark.txt',header=None)
df.head(10)
Copy the code

[Task 5] Characteristic engineering of hydraulic station

In DF1 and DF2, the data of each station in 18 and 19 years are presented respectively. H0 to H23 in the columns represent 0 to 23 points on the day respectively. Df3 records the daily weather conditions in this area in 18-19. Please complete the following tasks:

import pandas as pd
import numpy as np
df1 = pd.read_csv('yali18.csv')
df2 = pd.read_csv('yali19.csv')
df3 = pd.read_csv('qx1819.csv')
Copy the code
  • throughdf1anddf2structuredf, set the time as the index, the first column is the site number, the second column is the pressure at the corresponding time, arranged as follows (please replace the pressure value with the correct value) :
Site pressure 2018-01-01 00:00:00 1 1.0 2018-01-01 00:00:00 2 1.0... . . 2018-01-01 00:00:00 30 1.0 2018-01-01 01:00:00 1 1.0 2018-01-01 01:00:00 2 1.0... . . The 2019-12-31 23:00:00 30 1.0Copy the code
  • Constructed in the previous questiondfOn this basis, the following feature sequence orDataFrameAnd splice them one by onedfThe right side of the
    • The temperature difference between the highest temperature and the lowest temperature of the day
    • Whether there was a sandstorm, whether there was fog, whether there was rain, whether there was snow, whether it was sunny
    • Choose an appropriate method to measure the amount of rain/snow (construct two sequences representing the amount of rain/snow respectively)
    • Limit the wind direction to only four columns0-1Encoding (wind direction only, not size)
  • rightdfA series of hydraulic structures are characterized as follows:
    • The difference between the water pressure at the current moment and the average water pressure at the same hour in this month, for example, the current moment isThe 2018-05-20 17:00:00, the corresponding value to be subtracted is all of the current month17:00:00Mean value of water pressure at time point
    • The difference between the mean water pressure of the station on the weekend of the current time and the mean water pressure on the working day
    • Mean and standard deviation of water pressure of the site within 7 days before the current time0.95Quantile, total number of days with rain and snow
    • Mean and standard deviation of water pressure at the same hour of the station within 7 days prior to the current time0.95quantile
    • The time difference between the occurrence time of the highest water pressure value and the lowest water pressure value of the site on the day of the current time

Data download links: 】 pan.baidu.com/s/1Tqad4b7z… Extraction code: IJBD

df1 = pd.read_csv('practice/yali18.csv')
df1.head()
Copy the code