python - Concatenation of two columns into one rounds float -
i've got 2 dataframes want concat. both have same column , of different dtypes. 1 float, other string. want concat these columns while keeping granularity of float column. see below example:
import pandas pd df1 = pd.dataframe.from_dict({'row1':124.028125},orient='index') df2 = pd.dataframe.from_dict({'row2':'hello'},orient='index') df_ = pd.concat([df1,df2])
the df_
variable displayed as
df_ 0 row1 124.0281 row2 hello
basically how can concat these while keeping 124.028125 value row1?
thanks guys!
data not lost, not displayed sake of clarity.
if 1 access
df_[0]['row1']
one gets
124.028125
Comments
Post a Comment