title: how can keep index after normalization on columns in pandas dataframe between different range
body: <p>I applied normalization on multiple columns in Pandas dataframe by using for-loop under the condition of below:</p>
  
  <p>Normalization for A , B columns between : <strong>[-1 , +1]</strong></p>
  
  <p>Normalization for C column between      : <strong>[-40 , +150]</strong></p>
  
  <p>and replace results in  alternative dataframe let's call <code>norm_data</code> and store it as a csv file.</p>
  
  <p>my data is txt file <a href="https://drive.google.com/file/d/1Q7do3fgFAibjPPIMCrvs84yjgTOJR-Ep/view?usp=sharing" rel="nofollow noreferrer">dataset</a></p>
  
  <pre><code># Import and call the needed libraries
  import numpy as np
  import pandas as pd
  
  #Normalizing Formula
  
  def normalize(value, min_value, max_value, min_norm, max_norm):
      new_value = ((max_norm - min_norm)*((value - min_value)/(max_value - min_value))) + min_norm
  return new_value
  
  #Split data in three different lists A, B and C
  
  df1 = pd.read_csv('D:\me4.TXT', header=None)
  id_set = df1[df1.index % 4 == 0].astype('int').values
  A = df1[df1.index % 4 == 1].values
  B = df1[df1.index % 4 == 2].values
  C = df1[df1.index % 4 == 3].values
  data = {'A': A[:,0], 'B': B[:,0], 'C': C[:,0]} # arrays
  #df contains all the data
  df = pd.DataFrame(data, columns=['A','B','C'], index = id_set[:,0]) 
  df2 = pd.DataFrame(data, index= id_set[0:])
  print(df)
  
  #--------------------------------
  cycles = int(len(df)/480)
  print(cycles)
  
  #next iteration create all plots, change the numer of cycles
  for i in df:
      min_val = df[i].min()
      max_val = df[i].max()
      if i=='C':
          #Applying normalization for C between [-40,+150]
          data['C'] = normalize(df[i].values, min_val, max_val, -40, 150)
      elif i=='A':
          #Applying normalization for A , B between [-1,+1]
          data['A'] = normalize(df[i].values, min_val, max_val, -1, 1)
      else:
          data['B'] = normalize(df[i].values, min_val, max_val, -1, 1)
  
  
  norm_data = pd.DataFrame(data)
  print(norm_data)
  norm_data.to_csv('norm.csv')
  df2.to_csv('my_file.csv')
  print(df2)
  </code></pre>
  
  <p><strong>Problem</strong> is after normalization by help of @Lucas I've missed my <strong>index</strong> was labeled <code>id_set</code>. </p>
  
  <p>So far I got below output in my_file.csv including this error <code>TypeError
  unsupported format string passed to numpy.ndarray.__format__:</code></p>
  
  <pre><code>id_set         A         B           C
  ['0']      2.291171  -2.689658  -344.047912
  ['10']     2.176816  -4.381186  -335.936524
  ['20']     2.291171  -2.589725  -342.544885
  ['30']     2.176597  -6.360999     0.000000
  ['40']     2.577268  -1.993412  -344.326376
  ['50']     9.844076  -2.690917  -346.125859
  ['60']     2.061782  -2.889378  -346.378859
  ['70']     2.348300  -2.789547  -347.980986
  ['80']     6.973350  -1.893454  -337.884738
  ['90']     2.520040  -3.087004  -349.209006
  </code></pre>
  
  <p>which those <code>['']</code> are <strong>unwanted</strong>!
  my desired output should be like below after normalization :</p>
  
  <pre><code>id_set     A         B           C
  000   -0.716746  0.158663  112.403310
  010   -0.726023  0.037448  113.289702
  020   -0.716746  0.165824  112.567557
  030   -0.726040 -0.104426  150.000000
  040   -0.693538  0.208556  112.372881
  050   -0.104061  0.158573  112.176238
  060   -0.735354  0.144351  112.148590
  070   -0.712112  0.151505  111.973514
  080   -0.336932  0.215719  113.076807
  090   -0.698181  0.130189  111.839319
  010    0.068357 -0.019388  114.346421
  011    0.022007  0.165824  112.381444
  </code></pre>
  
  <p>Any ideas would be welcome since it's important data for me.</p>