Category : graph

I am counting events at my discord bot and I want to visualize how often a message event is called. I’ve got everything done, but now I have a json like this: {"1634461405.4596698": {"messages": 162, "commandusage": 0, "cpu": 16.6, "memory": 17.8}, "1634461465.4637358": {"messages": 298, "commandusage": 12, "cpu": 19.4, "memory": 17.9}, "1634461525.4868844": {"messages": 261, "commandusage": 12, ..

Read more

I wrote this code to convert data in .gml format but I got this error. what should I do? TypeError: descriptor ‘write_gml’ for ‘igraph._igraph.GraphBase’ objects doesn’t apply to a ‘str’ object code: import igraph as ig import pandas as pd a = pd.DataFrame(Matrix, index=tags, columns=tags) # # Get the values as np.array, it’s more convenenient. ..

Read more

I am trying to plot a timeline chart but they are stacking over each other. import pandas as pd import plotly.express as pex d1 = dict(Start= ‘2021-10-10 02:00:00’, Finish = ‘2021-10-10 09:00:00’, Task = ‘Sleep’) d2 = dict(Start= ‘2021-10-10 09:00:00’, Finish = ‘2021-10-10 09:30:00’, Task = ‘EAT’) d3 = dict(Start= ‘2021-10-10 09:30:00’, Finish = ‘2021-10-10 ..

Read more

import matplotlib.pyplot as plt import numpy as np import math import matplotlib.ticker as mtick from datetime import datetime # Set x-axis labels list x_labels = [”,’Jan’,’Feb’,’Mar’,’Apr’,’May’,’Jun’,’Jul’,’Aug’,’Sep’,’Oct’,’Nov’,’Dec’] historicals_year = int(datetime.now().year) – 1 chart_months = [curr_month] for x in np.arange(12): if chart_months[x] == 12: chart_months.append(1) else: chart_months.append(chart_months[x] + 1) chart_years = [historicals_year] for y in np.arange(12): i ..

Read more