自從2015年,馬斯克在Twitter上招攬工程師,并將親自面試應聘者,
特斯拉的自動駕駛技術仍然遠遠稱不上無人駕駛,但特斯拉Model S的車主已經可以在高速公路上把手離開方向盤,
特斯拉一向走在汽車科技創新的前列,馬斯克也不太可能在無人駕駛汽車領域落后于人,他今年9月接受Danish TV采訪時估計,特斯拉大概只需要3年就可以實作這一目標,
金九銀十,總結了特斯拉最近的一輪筆試,面試崗位無人駕駛演算法工程師,計算機視覺方向
面試的時間一般是兩個半小時,一共三道題,面試的答主肯定是通過了,
面試的環境屬于英文題目,系統自帶編譯環境python3.6編譯環境,不是自己的編譯器,下面答案僅供參考,不是特別的完善,有意見請留下你的評論
我在這對下面三道題做下總結:
先上三道題的題目圖片:
第一題


這是第一道題,把代碼寫到這個函式里即可
import numpy as np
def transform_image(array, shift):
pass
import numpy as np
def transform_image(array,shift):
if not shift or shift <0 or shift > image.shape[0]:
print("shift out of range!")
image_rotated = np.rot90(array, 1)
np.random.seed(0)
x = np.random.randn(array.shape[0], array.shape[1])
x_min = np.min(x)
x_max = np.max(x)
a =-0.5
b=0.5
x = a+(b-a) / (x_max - x_min) * (x - x_min)
x = np.around(x, 2)
image_noised = array + x
image_rolled = array.copy()
for i in range(shift):
p = image_rolled[:,image_rolled.shape[1]-1].copy()
a = image_rolled[:, 0:image_rolled.shape[1] - 1]
image_rolled[:,1:image_rolled.shape[1]] = a
image_rolled[:,0] = p
ret = {
"ret_rotated":image_rotated,
"ret_rolled":image_rolled,
"ret_flipped":image[::-1, ...],
"ret_noised":image_noised
}
return ret
if __name__=="__main__":
list1 = [
[0, 1, 1, 1, 0],
[0, 1, 0, 1, 0],
[0, 1, 1, 1, 0],
[0, 0, 0, 1, 0],
[0, 0, 0, 1, 0]
]
image = np.asarray(list1)
ret = transform_image(image,2)
第二題:


第二題寫到下面的函式中:
# you can write to stdout for debugging purposes, e.g.
# print("this is a debug message")
def solution(S, C): # write your code in Python 3.6
pass
def solution(s, c):
data = list(reader(StringIO(s)))
header = data.pop(0)
return int(max(row[header.index(c)] for row in data))
第三道題:


需要處理表格資料


第三道題 代碼也是寫到這個函式即可
import numpy as np
import pandas as pd
def solution(files):
pass
答案:
def solution(files):
data = pd.read_csv(files)
data['year'] = pd.DatetimeIndex(data['date']).year
data.groupby(['year'], sort=False)['vol'].max().reset_index()
result_date = list(data.iloc[data.groupby(['year']).apply(lambda x: x['vol'].idxmax())]['date'])
result_vol = list(data.iloc[data.groupby(['year']).apply(lambda x: x['vol'].idxmax())]['vol'])
return result_date, result_vol
result_date, result_vol = solution('framp.csv')
print(result_date)
print(result_vol)
結果:
['2005-09-23', '2006-05-31', '2007-02-01', '2008-05-14', '2009-02-06', '2010-05-26', '2011-08-31', '2012-11-06', '2013-10-10', '2014-04-09', '2015-11-30', '2016-06-28', '2017-02-16', '2018-09-21', '2019-01-09']
[306208914, 28831088, 18388511, 24150048, 35246018, 54335576, 35866126, 59381774, 38320297, 21251451, 17545094, 17390752, 17621885, 28281682, 9451453]
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/298193.html
標籤:其他
