Tuesday, September 27, 2022

Line plot with multiple lines for page views for survival8 (Sep 2022)

import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.pyplot import figure
import numpy as np

df_uganda = pd.read_excel('20220927.xlsx', sheet_name = 'Uganda')
df_brazil = pd.read_excel('20220927.xlsx', sheet_name = 'Brazil')
df_canada = pd.read_excel('20220927.xlsx', sheet_name = 'Canada')
df_uk = pd.read_excel('20220927.xlsx', sheet_name = 'UK')
df_kenya = pd.read_excel('20220927.xlsx', sheet_name = 'Kenya')
df_uae = pd.read_excel('20220927.xlsx', sheet_name = 'UAE')
df_germany = pd.read_excel('20220927.xlsx', sheet_name = 'Germany')
df_russia = pd.read_excel('20220927.xlsx', sheet_name = 'Russia')
df_us = pd.read_excel('20220927.xlsx', sheet_name = 'US')
df_india = pd.read_excel('20220927.xlsx', sheet_name = 'India')
df_global = pd.read_excel('20220927.xlsx', sheet_name = 'Global')

df = df_uganda.merge(df_brazil, on = 'Timestamp', how = 'inner')
df = df.merge(df_canada, on = 'Timestamp', how = 'inner')
df = df.merge(df_uk, on = 'Timestamp', how = 'inner')
df = df.merge(df_kenya, on = 'Timestamp', how = 'inner')
df = df.merge(df_uae, on = 'Timestamp', how = 'inner')
df = df.merge(df_germany, on = 'Timestamp', how = 'inner')
df = df.merge(df_russia, on = 'Timestamp', how = 'inner')
df = df.merge(df_us, on = 'Timestamp', how = 'inner')
df = df.merge(df_india, on = 'Timestamp', how = 'inner')
df = df.merge(df_global, on = 'Timestamp', how = 'inner')

df.tail()


Range 10K

figure(figsize=(16, 6), dpi=80) plt.plot(df['Timestamp'], df['Current Views in UK'], label = "UK") plt.plot(df['Timestamp'], df['Current Views in Kenya'], label = "Kenya") plt.plot(df['Timestamp'], df['Current Views in UAE'], label = "UAE") plt.xticks(rotation = 90) plt.legend() plt.show()

UAE, UK and Kenya

Range 20K

figure(figsize=(16, 6), dpi=80) plt.plot(df['Timestamp'], df['Current Views in Germany'], label = "Germany") plt.plot(df['Timestamp'], df['Current Views in Russia'], label = "Russia") plt.xticks(rotation = 90) plt.legend() plt.show()

Germany, Russia

Tags: Python,Technology,Data Visualization,

No comments:

Post a Comment