title: Using JSON data stored in a class?
body: <p>I have a class with the following definition:</p>
  
  <pre><code>class Profile():
      def __init__(self, json_data):
          obj = json.loads(json_data)
          self.name = obj["name"]
          self.data = sorted(obj["data"])
  </code></pre>
  
  <p>The profile is in a separate file with this naming convention: <code>[profilename].json</code></p>
  
  <p>And as an example contains: </p>
  
  <pre><code>{"type": "profile", "data": [[0, 25], [90, 150], [180, 183], [211, 237], [234, 184], [313, 26]], "name": "leadfree"}
  </code></pre>
  
  <p>I need to be able to get the number from position <code>[4][0]</code> inside <code>data</code>, so the number <code>234</code> in this case, using a function inside the profile class.</p>
  
  <p>I currently have:</p>
  
  <pre><code>def get_stage5time(self):
      return self.data[4][0]
  </code></pre>
  
  <p>But I am worried that isn't it, as it is using <code>sorted</code>, which may jeopardise the function. At the same time it may not have any effect, since anything in position <code>[0]</code> so <code>[0][0]</code>, <code>[1][0]</code> will actually at all times be in order, as time only goes up.</p>
  
  <p>How would I be able to point to 234? Is the way I am doing it currently correct or am I missing something?</p>