May-06-2019, 08:19 PM
Hi all. I'm trying run the following code and I keep getting the "TypeError: expected string or bytes-like object" error:
The df_sar dataframe has the following columns and types:
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 258710 entries, 0 to 258709
Data columns (total 9 columns):
CASE_ID 258710 non-null int64
CASE_NUMBER 258710 non-null object
Priority 258710 non-null object
SAR_Filed_Date 258710 non-null object
SAR_Narrative 258702 non-null object
REFERRAL_SUBTYPE_ID 258710 non-null int64
ZONE_ID 258710 non-null int64
BUSINESS_INDICATOR_ID 258710 non-null int64
WORKFLOW_STATE_ID 258710 non-null int64
dtypes: int64(5), object(4)
memory usage: 17.8+ MB
Any ideas?
df_sar['sar_details_sent'] = df_sar['sar_details'].apply(lambda x: nltk.sent_tokenize(x))
The df_sar dataframe has the following columns and types:
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 258710 entries, 0 to 258709
Data columns (total 9 columns):
CASE_ID 258710 non-null int64
CASE_NUMBER 258710 non-null object
Priority 258710 non-null object
SAR_Filed_Date 258710 non-null object
SAR_Narrative 258702 non-null object
REFERRAL_SUBTYPE_ID 258710 non-null int64
ZONE_ID 258710 non-null int64
BUSINESS_INDICATOR_ID 258710 non-null int64
WORKFLOW_STATE_ID 258710 non-null int64
dtypes: int64(5), object(4)
memory usage: 17.8+ MB
Any ideas?