title: how to call a variable from another function within a classs
body: <p>I'm trying to call a variable from another function in the same <code>PyQT5 class</code> but it returns error. I basically get the values using a file picker and put it in panda and store the results in data2</p>
  
  <p>I have checked the indentations.</p>
  
  <p><strong>python</strong></p>
  
  <pre><code>class Ui_Dialog(QWidget):
  
      def selectFile(self):
          options = QFileDialog.Options()
          options |= QFileDialog.DontUseNativeDialog
          fileName, _ = QFileDialog.getOpenFileName(self, "Open File", "", "All Files (*);;Excel Files (*.xlsx)", options=options)
          # print(fileName)
          if fileName:
              # df=pd.read_excel(fileName,Header=None)
              self.variableOne = fileName
              # return self.variableOne
              print(self.variableOne)
              # return fileName
              # type(fileName)
              # global data
              # data=np.asarray(df)
  
      def pandaGetValues(self):
          self.df=pd.read_excel(self.variabelOne,Header=None)
          self.data=np.asarray(self.df)
          self.data2=self.data[1:-1,:]
  
      def get_voltage(self, r, t):
          all=[]
          data3=self.data2
          for i in range (1,len(data3[0]),3):
              self.mm = [] 
              times=[]
              self.times2=[]
              self.header = self.data[0,i]
              firstnumber = 0
              first_index = 0
              #temp=np.empty([], dtype=int)
              self.temp=[]
              m=np.where((data3[1:,i] &gt;= r ) &amp; (data3[1:,i] &lt;= t )) 
              self.final=[]
              # print('\n\n line number',i)
              print(self.data[0,i])
              #return i
              self.mm=self.m[0]
              self.mm=np.asarray(self.mm)
              print(self.mm)
  
  </code></pre>
  
  <blockquote>
    <p>AttributeError: 'Ui_Dialog' object has no attribute 'data2'</p>
  </blockquote>