I am looking to calculate the Flesch-Kincaid grade level score of FOMC Statements. When trying to add a new variable for the Flesch-Kincaid score to the dataframe which includes FOMC Statements, I am getting an error which says: "unhashable type error: Series". How can I generate the new variable for the Flesch-Kincaid Score?
I first downloaded the FOMC statements using Fedtools:
from FedTools import MonetaryPolicyCommittee
fomc_statements = MonetaryPolicyCommittee().find_statements()
I used the following code to try to calculate the Flesch Kincaid score of the fomc statements, stored in a variable called 'FOMC_Statements'.
import textstat
fomc_statements2 = fomc_statements.assign(readability = textstat.flesch_kincaid_grade(fomc_statements.FOMC_Statements))
This was causing the unhashable type error: Series