This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
I have only recently started using Alteryx and really enjoy how much it has to offer. I'm currently working with an interactive Jupyter notebook and my code runs beautifully smoothly until I try to write back to Alteryx. The trouble seems to be my date column but since it leaves out my index (which is the date), I needed to save a copy of it to bring it back to Alteryx.
Here's the error I get ('ds' is the date column):
[CachedData.write] couldn't find conversion for ds ("datetime64[ns]") from pandas to yxdb
followed by some Python error, but this seems to be a conversion rather than python problem.
For full disclosure, here's my code ('first_listing_Date' is the datetime column, which later becomes the index):
from ayx import Alteryx import pandas as pd df_grandavg = Alteryx.read("#1")
# set datetime for time series df_grandavg['first_listing_Date'] = pd.to_datetime(df_grandavg['first_listing_Date']) gr = df_grandavg['Office_name'].unique()
# create rolling means df_grandavg = df_grandavg.set_index('first_listing_Date') pivoted_df = pd.pivot_table(df_grandavg, index='first_listing_Date', columns='Office_name', values='Count', aggfunc='first')
for g in gr: pivoted_df[[g+'_7day']] = pivoted_df[[g]].rolling(7,center=True).mean() pivoted_df[[g+'_14day']] = pivoted_df[[g]].rolling(14,center=True).mean()