Pandas Dataframe can't loc columns with different datatypes

I have a Pandas DataFrame with different datatypes across columns (but the same datatype within each column). When I try to loc some new data into row 0, the first row gets replaced with the column names.

This does not happen when the columns are all the same datatype, however.

import numpy as np
import pandas as pd

test = pd.DataFrame({'int':[0],
    'float':[0.],
    'str':['z'],})
test.loc[(0)] = {
    'int':0,
    'float':0.1,
    'str':'a',}
test.loc[(1)] = {
    'int':1,
    'float':1.1,
    'str':'b',}

test2 = pd.DataFrame({'float0':[0.],
    'float1':[0.],
    'float2':[0.],})
test2.loc[(0)] = {
    'float0':0.,
    'float1':0.1,
    'float2':0.2,}
test2.loc[(1)] = {
    'float0':1.0,
    'float1':1.1,
    'float2':1.2,}
print(test.to_string())

   int  float  str
0  int  float  str
1    1    1.1    b

print(test2.to_string())

   float0  float1  float2
0     0.0     0.1     0.2
1     1.0     1.1     1.2