on 09-26-2019 2:08 PM
I am trying to use the python operator to do some basic data manipulation while reading the csv file from amazon s3 .I tried to read the file using pandas library but it is throwing encoding error.I tried a lot but decoding did not work for me. I hope the attached image would give a clearer picture.Thanks in Advance.
Hello Vikas, Here is some code that is working for me in a Python 3 operator. Very similar setup to yours, CSV file is in S3, the Real File operator brings it into the pipeline. (any reason you are using Python 2 by the way?)
The encoding will depend on your own file I suppose. If this code is not working for you, testing the Python code and encoding outside Data Hub might help
def on_input(data):
import pandas as pd
import io
df_data = pd.read_csv(io.StringIO(data), sep=";")
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.