列名にスペースやハイフンなどが入っている場合、色々なデータ操作に支障を来す場合があります。
処理を行う前に、置換しておくとよいでしょう

元データ:data1

In [8]: data1.head()
Out[8]:
   age  workclass  fnlwgt     education  educational-num      marital-status  \
0   25    Private  226802          11th                7       Never-married
1   38    Private   89814       HS-grad                9  Married-civ-spouse
2   28  Local-gov  336951    Assoc-acdm               12  Married-civ-spouse
3   44    Private  160323  Some-college               10  Married-civ-spouse
4   18          ?  103497  Some-college               10       Never-married

          occupation relationship   race  gender  capital-gain  capital-loss  \
0  Machine-op-inspct    Own-child  Black    Male             0             0
1    Farming-fishing      Husband  White    Male             0             0
2    Protective-serv      Husband  White    Male             0             0
3  Machine-op-inspct      Husband  Black    Male          7688             0
4                  ?    Own-child  White  Female             0             0

   hours-per-week native-country income
0              40  United-States  <=50K
1              50  United-States  <=50K 2 40 United-States >50K
3              40  United-States   >50K
4              30  United-States  <=50K

列名の文字列を置換

この場合、「-」「_」に置換してます。

例1

data1.columns = data1.columns.str.replace("-", "_")
data1.head()

例1の結果

   age  workclass  fnlwgt     education  educational_num      marital_status  \
0   25    Private  226802          11th                7       Never-married
1   38    Private   89814       HS-grad                9  Married-civ-spouse
2   28  Local-gov  336951    Assoc-acdm               12  Married-civ-spouse
3   44    Private  160323  Some-college               10  Married-civ-spouse
4   18          ?  103497  Some-college               10       Never-married
          occupation relationship   race  gender  capital_gain  capital_loss  \
0  Machine-op-inspct    Own-child  Black    Male             0             0
1    Farming-fishing      Husband  White    Male             0             0
2    Protective-serv      Husband  White    Male             0             0
3  Machine-op-inspct      Husband  Black    Male          7688             0
4                  ?    Own-child  White  Female             0             0

   hours_per_week native_country income
0              40  United-States  <=50K
1              50  United-States  <=50K 2 40 United-States >50K
3              40  United-States   >50K
4              30  United-States  <=50K

列名の文字列を置換(複数置換)

この場合、「a」「-」「_」に置換してます。

例2

searchfor = ["a", "-"]

data1.columns = data1.columns.str.replace("|".join(searchfor), "_")
data1.head()

例2の結果

   _ge  workcl_ss  fnlwgt     educ_tion  educ_tion_l_num      m_rit_l_st_tus  \
0   25    Private  226802          11th                7       Never-married
1   38    Private   89814       HS-grad                9  Married-civ-spouse
2   28  Local-gov  336951    Assoc-acdm               12  Married-civ-spouse
3   44    Private  160323  Some-college               10  Married-civ-spouse
4   18          ?  103497  Some-college               10       Never-married

          occup_tion rel_tionship   r_ce  gender  c_pit_l_g_in  c_pit_l_loss  \
0  Machine-op-inspct    Own-child  Black    Male             0             0
1    Farming-fishing      Husband  White    Male             0             0
2    Protective-serv      Husband  White    Male             0             0
3  Machine-op-inspct      Husband  Black    Male          7688             0
4                  ?    Own-child  White  Female             0             0

   hours_per_week n_tive_country income
0              40  United-States  <=50K
1              50  United-States  <=50K 2 40 United-States >50K
3              40  United-States   >50K
4              30  United-States  <=50K