title: Why are my global variables not updating after i call my functions?
body: <p>I created a couple of functions which load a dataset from github and then combines it. This part of the code works correctly. My problem arises when I run the combine function for a second time. </p>
  
  <p>What I tried when testing if my functions work as intended.</p>
  
  <pre><code>loadDataset("https://raw.githubusercontent.com/AAF108/ml/master/test3")
  print (dataset)
  combine({"data": [{"room_temperature": 20, "light_intensity": 
  511,"humidity": 50}]})
  print(combinedData)
  </code></pre>
  
  <p>the URL in loadDataset is this:  </p>
  
  <pre><code>{"data": [{"room_temperature": 20, "light_intensity": 511,"humidity": 50}]}
  </code></pre>
  
  <p>When I run this part I get (which is what I expected to get): </p>
  
  <pre><code>   humidity  light_intensity  room_temperature
  0        50              511                20
  
  
     humidity  light_intensity  room_temperature
  0        50              511                20
  0        50              511                20
  </code></pre>
  
  <p>Below is the code for the functions I made:</p>
  
  <pre><code>def loadDataset(url):
      global dataset
      dataset = pd.read_json(url)
  
  def combine(obj):
      global combinedData
  
      json= obj
  
      df1 = pd.DataFrame(dataset)
      df2 = pd.DataFrame(json["data"])
  
      combinedData = pd.concat([df1, df2])
  </code></pre>
  
  <p>My problem arises when I do this:</p>
  
  <pre><code>loadDataset("https://raw.githubusercontent.com/AAF108/ml/master/test3")
  print (dataset)
  combine({"data": [{"room_temperature": 20, "light_intensity": 
  511,"humidity": 50}]})
  print(combinedData)
  combine({"data": [{"room_temperature": 20, "light_intensity": 
  511,"humidity": 50}]})
  print(combinedData)
  </code></pre>
  
  <p>What I Expect:</p>
  
  <pre><code>   humidity  light_intensity  room_temperature
  0        50              511                20
  
  
     humidity  light_intensity  room_temperature
  0        50              511                20
  0        50              511                20
  0        50              511                20
  </code></pre>
  
  <p>What I get instead:</p>
  
  <pre><code>   humidity  light_intensity  room_temperature
  0        50              511                20
  
  
     humidity  light_intensity  room_temperature
  0        50              511                20
  0        50              511                20
  </code></pre>
  
  <p>I'm not sure why my combineData is not updating.</p>