Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Output Python tool

Istwineres
8 - Asteroid

Hi, the Alteryx.write(df,1) line doesn't output the entire dataframe only the first row, when I try to print it out in the jupyter env the dataframe is correctly built an displayed. Thanks!

4 REPLIES 4
Jonathan-Sherman
15 - Aurora
15 - Aurora

Hi @Istwineres,

 

Might be due to the standard profiling limit of the results pane (10mb data) and not your Python code, if you add a browse tool after the "1" anchor of the Python tool and re-run that might resolve your issue?

 

Kind regards,

Jonathan

Istwineres
8 - Asteroid

The browser tool is empty, the dataframe is filled with just 8 records. I think the problem is how I built the dataframe: cannot convert list into series and then dataframe

Istwineres
8 - Asteroid
SUCCESS: writing outgoing connection data 1
SUCCESS: writing outgoing connection data 2
SUCCESS: writing outgoing connection data 3

But nothing in output except first row for the dataframe in #1 output connection 

Istwineres
8 - Asteroid

That's the code:

from ayx import Alteryx
from zipfile import ZipFile
import fnmatch
import pandas as pd
import os

data = Alteryx.read('#1')
full_path_zip = data.iloc[0][0]
directory = data.iloc[0][1]


with ZipFile(full_path_zip,'r') as zipObj:
zipObj.extractall(path=directory)

dataf= pd.DataFrame()
list_full_path = []
for path in os.listdir(directory):
full_path = os.path.join(directory,path)
if os.path.isfile(full_path):
if fnmatch.fnmatch(full_path,'*.csv'):
list_full_path.append(full_path)

dataf.insert(0,'file_full_path',list_full_path)

file_size_list = []
for path in list_full_path:
file_size_list.append(os.path.getsize(path))
dataf.insert(1,'file_size',file_size_list)

os.remove(full_path_zip)
Alteryx.write(dataf,1)

Labels
Top Solution Authors