title: Convert Float to String in Pandas
body: <p>I am a little confused with datatype "object" in Pandas. What exactly is "object"? </p>
  
  <p>I would like to change the variable "SpT" (see below) from object to String. </p>
  
  <pre><code>&gt; df_cleaned.dtypes
      Vmag        float64
      RA          float64
      DE          float64
      Plx         float64
      pmRA        float64
      pmDE        float64
      B-V         float64
      SpT          object
      M_V         float64
      distance    float64
      dtype: object
  </code></pre>
  
  <p>For this I do the following: </p>
  
  <pre><code>df_cleaned['SpT'] = df_cleaned['SpT'].astype(str)
  </code></pre>
  
  <p>But that has no effect on the dtype of SpT. </p>
  
  <p>The reason for doing is when I do the following: </p>
  
  <pre><code>f = lambda s: (len(s) &gt;= 2)  and (s[0].isalpha()) and (s[1].isdigit())
  i  = df_cleaned['SpT'].apply(f)
  df_cleaned = df_cleaned[i]
  </code></pre>
  
  <p>I get: </p>
  
  <pre><code>TypeError: object of type 'float' has no len()
  </code></pre>
  
  <p>Hence, I believe if I convert "object" to "String", I will get to do what I want. </p>
  
  <p>More info: This is how SpT looks like: </p>
  
  <pre><code>HIP
  1                F5
  2               K3V
  3                B9
  4               F0V
  5             G8III
  6              M0V:
  7                G0
  8      M6e-M8.5e Tc
  9                G5
  10              F6V
  11               A2
  12            K4III
  13            K0III
  14               K0
  15               K2
  ...
  118307    M2III:
  118308        K:
  118309        A2
  118310        K5
  118312        G5
  118313        F0
  118314        K0
  118315     K0III
  118316        F2
  118317        F8
  118318        K2
  118319       G2V
  118320        K0
  118321       G5V
  118322      B9IV
  Name: SpT, Length: 114472, dtype: object
  </code></pre>