Multiple issues with `StrInCol`
Opened this issue · 0 comments
kaushik327 commented
Reproduce:
df = pd.read_csv('./datasets/dataranch__supermarket-sales-prediction-xgboost-fastai__SampleSuperstore.csv')
if '41' in df['Profit'].to_string():
pass
This errors, since somewhere in the rewriting process, df['Profit']
becomes df[Profit]
, which causes NameError: name 'Profit' is not defined
.
df_multi_index = df.set_index(['Postal Code', 'Sub-Category'])
for col in df_multi_index.columns:
if 'ou' in df_multi_index[col].to_string():
pass
This also errors, since the existing rewriting rule (which uses index.astype(str)
) doesn't work for a MultiIndex
, yielding TypeError: Setting a MultiIndex dtype to anything other than object is not supported
.