"import pandas as pd \n\n# Read file \nwith open(file.txt, r) as f: \n    words = f.read().split() \n\n# Create dataframe \nwords_df = pd.DataFrame(words, columns=[word]) \n\n# Count the occurrences of each word \nwords_df[number of occurrences] = words_df.groupby(word).transform(count) \n\n# Calculate the frequency of each word \nwords_df[frequency] = words_df[number of occurrences]/len(words) \n\n# Print the dataframe \nprint(words_df)"
Convert the text document into a spreadsheet which contains three columns: word, number of occurrences, and frequency.?