Skip to content
Permalink
main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
import pandas as pd
import numpy as np
spatio_data_file = "./data/SpatialFeatures.csv"
raw_spatio_feature = pd.read_csv(spatio_data_file)
def get_feauture_by_name(data,name):
feature = data[name]
feature = feature.fillna(0).to_numpy()
feature = feature/feature.max()
feature = feature.reshape(16,8)
feature = feature[::-1,:]
return feature
def get_feature_list(data,name_list):
result_array = np.empty((len(name_list),16,8))
for i in range(len(name_list)):
result_array[i] = get_feauture_by_name(data,name_list[i])
return result_array
feature_list = ["BikeLane_miles","AADT","Pop_Density","StationNum"]
def gen_features(feature_list = feature_list):
feature_array = get_feature_list(raw_spatio_feature,feature_list)
return feature_array