code: def __fetch_heatmap_data_from_profile(self):
          
          # Read lines from file.
          with open(self.pyfile.path, "r") as file_to_read:
              for line in file_to_read:
                  # Remove return char from the end of the line and add a
                  # space in the beginning for better visibility.
                  self.pyfile.lines.append("  " + line.strip("\n"))
  
          # Total number of lines in file.
          self.pyfile.length = len(self.pyfile.lines)
  
          # Fetch line profiles.
          line_profiles = self.__get_line_profile_data()
  
          # Creating an array of data points. As the profile keys are 1 indexed
          # we should range from 1 to line_count + 1 and not 0 to line_count.
          arr = []
          for line_num in range(1, self.pyfile.length + 1):
              if line_num in line_profiles:
                  # line_profiles[i] will have multiple entries if line i is
                  # invoked from multiple places in the code. Here we sum over
                  # each invocation to get the total time spent on that line.
                  line_times = [
                      ltime for _, ltime in line_profiles[line_num].values()
                  ]
                  arr.append([sum(line_times)])
              else:
                  arr.append([0.0])
  
          # Create nd-array from list of data points.
          self.pyfile.data = np.array(arr)
docs: Method to create heatmap data from profile information.