title: Get pandas dataframe with user input string of dataframe name for a function
body: <p>i have several Pandas dataframes with  names e.g.-timeslices1_df. i want to extract certain columns from this dataframe but with user Input conditions.</p>
  <pre class="lang-py prettyprint-override"><code>def user_input_dataframe():
      
      timeslices_number=int(input(&quot;timeslice_number:&quot;))
      process_number=int(input(&quot;process_number:&quot;))
      core_number=input(&quot;core_number:&quot;)
      #timeslices_4__profilerdataprocess_45__c0_us_ example column_name
      dataframe_name=&quot;timeslices_&quot;+str(timeslices_number)+&quot;_df&quot;
      column_name=&quot;timeslices_&quot;+str(timeslices_number) +'__'+ &quot;profilerdataprocess_&quot;+str(process_number)+'__'+str(core_number)+'_'+&quot;us&quot;
      #print(column_name)
      list_of_datasets = [timeslices0_df,timeslices1_df,timeslices2_df ,timeslices3_df,timeslices4_df,timeslices5_df,
                         timeslices6_df,timeslices7_df,timeslices8_df]
      for index, dataset in enumerate(list_of_datasets):
          if  dataframe_name in dataset:
              X_df=pd.DataFrame()
              X_df.append(dataframe_name)
              X1 = [col for col in X_df.columns if column_name in col]
              X2=pd.DataFrame()
              X2=X_df[X1]
              X2['date'] = pd.date_range(start='1/1/2020', periods=len(X1), freq='D')
              X2=X2.set_index('date')
              return X2
  </code></pre>
  <p>I cannot do it as the user Input is a string. I get this error.
  Is there any other way of retrieving the dataframe using user Input function?</p>
  <pre><code>Sample Input: 
     timeslice_number:4
  
     process_number:45
   
     core_number:c0
  Expected Output:new dataframe with a single selected column
  
  Actual Output: Empty dataframe
  </code></pre>