I'm working with a dataframe that only contains two columns, one categorical Peril and one numerical Frequency. I am trying to create a bar chart but I keep getting an error:
AttributeError: 'str' object has no attribute 'get'
when I run the following line:
sns.catplot(data='df', x='Frequency', y='Peril', kind='bar')
I've successfully plotted using this code before. I even went back and tried it in the old file and it works fine. I was originally thinking that maybe Frequency was being stored as a string instead of an integer, but when I ran df.info() it returned
RangeIndex: 36 entries, 0 to 35
Data columns (total 2 columns):
Peril 36 non-null object
Frequency 36 non-null int64
dtypes: int64(1), object(1)
memory usage: 656.0+ bytes
Currently stuck on how to resolve this issue.
data='df'anddata=df