In [1]:
import pandas as pd

In [2]:
df_mix = pd.DataFrame({'col_int': [0, 1, 2], 'col_float': [0.1, 0.2, 0.3]}, index=['A', 'B', 'C'])
print(df_mix)


   col_int  col_float
A        0        0.1
B        1        0.2
C        2        0.3

In [3]:
print(df_mix.dtypes)


col_int        int64
col_float    float64
dtype: object

In [4]:
print(df_mix['col_int'] + df_mix['col_float'])


A    0.1
B    1.2
C    2.3
dtype: float64

In [5]:
print(df_mix / 1)


   col_int  col_float
A      0.0        0.1
B      1.0        0.2
C      2.0        0.3

In [6]:
print((df_mix / 1).dtypes)


col_int      float64
col_float    float64
dtype: object

In [7]:
print(df_mix * 1)


   col_int  col_float
A        0        0.1
B        1        0.2
C        2        0.3

In [8]:
print((df_mix * 1).dtypes)


col_int        int64
col_float    float64
dtype: object

In [9]:
print(df_mix * 1.0)


   col_int  col_float
A      0.0        0.1
B      1.0        0.2
C      2.0        0.3

In [10]:
print((df_mix * 1.0).dtypes)


col_int      float64
col_float    float64
dtype: object

In [11]:
print(df_mix.loc['A'])


col_int      0.0
col_float    0.1
Name: A, dtype: float64

In [12]:
print(df_mix.T)


             A    B    C
col_int    0.0  1.0  2.0
col_float  0.1  0.2  0.3

In [13]:
print(df_mix.T.dtypes)


A    float64
B    float64
C    float64
dtype: object

In [14]:
df_mix.at['A', 'col_int'] = 10.9
df_mix.at['A', 'col_float'] = 10
print(df_mix)


   col_int  col_float
A       10       10.0
B        1        0.2
C        2        0.3

In [15]:
print(df_mix.dtypes)


col_int        int64
col_float    float64
dtype: object

In [16]:
# df_mix.at['A', 'col_int'] = 'abc'
# ValueError: invalid literal for int() with base 10: 'abc'