python – Expected 2D array, got 1D array instead error

I am getting the error as:

ValueError: Expected 2D array, got 1D array instead: array=(‘2020-08-03T00:00:00.000000000’ ‘2020-08-03T00:00:00.000000000’ ‘2020-08-03T00:00:00.000000000’ ‘2020-08-03T00:00:00.000000000’ ‘2020-08-25T00:00:00.000000000’ ‘2020-08-25T00:00:00.000000000’ ‘2020-08-25T00:00:00.000000000’ ‘2020-08-25T00:00:00.000000000’ ‘2020-08-25T00:00:00.000000000’ ‘2020-08-25T00:00:00.000000000’). Reshape your data either using array.reshape(-1, 1) if your data has a single feature or array.reshape(1, -1) if it contains a single sample.

while executing the following code:

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.neighbors import KNeighborsRegressor

data=pd.read_csv("detalle_pedidos6.csv")

train_x = data('Fecha')(:200)
train_y = data('VentasTotales')(:200)

KNR = KNeighborsRegressor(20)
KNR.fit(train_x, train_y)