Как преобразовать формат датыPython

Программы на Python
Anonymous
Как преобразовать формат даты

Сообщение Anonymous »

Я обучал модель на Python. Ниже приведен мой код.
Произошла ошибка.

Код: Выделить всё

ValueError: could not convert string to float: '2020-03-24'

Код: Выделить всё

#split the data into x and y
x = tsla.drop("Date", axis=1)
y = tsla['Date']

#split the data into train and test
x_train, x_test, y_train, y_tset = train_test_split(x,y, test_size=0.2, random_state=42)

# model
model = LinearRegression()
model.fit(x_train, y_train)
Я пытаюсь обучить модель по x y.

Подробнее здесь: https://stackoverflow.com/questions/787 ... ate-formet

Вернуться в «Python»