dave on Nostr: Me: # importing the libraries import pandas as pd import matplotlib.pyplot as plt ...
Me:
# importing the libraries
import pandas as pd
import matplotlib.pyplot as plt
from nostr import get_posts
# get posts data
posts = get_posts()
# create a dataframe
df = pd.DataFrame(posts)
# add hour of post column
df['hour_of_post'] = df['timestamp'].dt.hour
# group and count posts by hour
counts = df.groupby('hour_of_post')['post'].count()
# plot in a bar graph
plt.bar(counts.index,counts.values)
plt.xlabel('Hour of Post')
plt.ylabel('No. of Posts')
plt.show()
# importing the libraries
import pandas as pd
import matplotlib.pyplot as plt
from nostr import get_posts
# get posts data
posts = get_posts()
# create a dataframe
df = pd.DataFrame(posts)
# add hour of post column
df['hour_of_post'] = df['timestamp'].dt.hour
# group and count posts by hour
counts = df.groupby('hour_of_post')['post'].count()
# plot in a bar graph
plt.bar(counts.index,counts.values)
plt.xlabel('Hour of Post')
plt.ylabel('No. of Posts')
plt.show()