I have a list of columns for which I have ensured that the data types are correct:
Date1 | Date2 | Geleverde Kg | Oderhvh |
---|---|---|---|
2021-03-02 | 2021-03-01 | 3000.0 | 3000.0 |
2021-03-02 | 2021-03-04 | 15000.0 | 15000.0 |
I changed the datatypes (note: categorical and numerical refer to a list of column names):
orders[categorical] = orders[categorical].astype('str')
orders[numeric_non_date] = orders[numeric_non_date].values.astype(float)
The schema looks correct
However, when I make a kde plot, I get a type error:
ax = sns.kdeplot (data = orders, x = "Geleverde Kg")
TypeError: cannot astype a datetimelike from [datetime64[ns]] to [float64]
What is going on here? This feature doesn't have a datetime datatype, so why am I getting this error?