2

In the attached image (attached dataframe and plotted line graph snapshots) - series index ranges from 242.0 to 252.0 but data for index 242.0 and 243.0 is missing. What is the issue here?

Following is the relevant code:

import re
import json as js
import matplotlib.pyplot as plt
import pandas as pd

def plot(collector, run_type, stat_type):
       ax = plt.gca()
       run_info = collector.series[run_type]['info']
       dfs = []
       ctr_str = 'Type {}'
       ctr = 0
       for var in run_info:
           ctr += 1
           if not re.search(stat_type, var):
               continue
           var_info = run_info[var]
           try:
               dfs.append(pd.DataFrame({var: var_info['data']}, index=var_info['runs']))
           except:
               print(var_info['data'])
               print(var_info['runs'])
               x=1
       pd.concat(dfs, axis=1, sort=False).sort_index().plot(kind='line', ax=ax)
       plt.show(block=True)

enter image description here

1 Answer 1

1

For 243, the values occur in those columns in which there is only one value in the entire column(Type1, Type2, and Type5), thus Line plot won't plot those lines. For 242, seems nan is breaking the line of the column. However you need to handle Nan before plotting.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.