the sample file looks like thisx-axis should have alphabets ranging from a-z+A-Z and y-axis should plot their respective frequencies from content column
import pandas as pd
import numpy as np
import string
from matplotlib import pyplot as plt
plt.style.use('fivethirtyeight')
col_list = ["tweet_id","sentiment","author","content"]
df = pd.read_csv("sample.csv",usecols=col_list)
freq = (df["content"])
frequencies = {}
for sentence in freq:
for char in sentence:
if char in frequencies:
frequencies[char] += 1
else:
frequencies[char] = 1
frequency = str(frequencies)
bins = [chr(i + ord('a')) for i in range(26)].__add__([chr(j + ord('A')) for j in range(26)])
plt.title('data')
plt.xlabel('letters')
plt.ylabel('frequencies')
plt.hist(bins,frequency,edgecolor ='black')
plt.tight_layout()
plt.show()
bins
andfrequency
look like?