This is the code automatically generated by ibm cloud when i upload my dataset and i tried encoding='latin-1' but still it is giving me error
import os, types
import pandas as pd
from botocore.client import Config
import ibm_boto3
def __iter__(self): return 0
if os.environ.get('RUNTIME_ENV_LOCATION_TYPE') == 'external':
endpoint_3660ea30b8c954806ac4 = 'https://s3.us.cloud-object-storage.appdomain.cloud'
else:
endpoint_3660ea30b8c954806ac4 = 'https://s3.private.us.cloud-object-storage.appdomain.cloud'
client_3660ea30b8c954806ac4 = ibm_boto3.client(service_name='s3',
ibm_api_key_id='xjHcqdBlY9iaaD7qu17e6-njKJPFSdGWk4d',
ibm_auth_endpoint="https://iam.cloud.ibm.com/oidc/token",
config=Config(signature_version='oauth'),
endpoint_url=endpoint_3660ea30b8c954806ac4)
body = client_3660ea30b8c954806ac4.get_object(Bucket='spamdetectionmodel-donotdelete-pr-mt98rs41prv05c',Key='spam.csv')['Body']
# add missing __iter__ method, so pandas accepts body as file-like object
if not hasattr(body, "__iter__"): body.__iter__ = types.MethodType( __iter__, body )
df_data_1 = pd.read_csv(body)
df_data_1.head()
Error:
'utf-8' codec can't decode bytes in position 135-136: invalid continuation byte