there is import from CSV file a big chunk of data, Pandas assigned automatically dtype to colums(138), there is one column I have to compare for extract result.
I tried with astype()
and apply()
method for change column without success.
I tried with this below:
In [78]: df['PDP_ADDIPV4_01']=df['PDP_ADDIPV4_01'].astype(str,errors='ignore')
df['PDP_ADDIPV4_01'].dtype
Out[78]: dtype('O')
In [79]: df['PDP_ADDIPV4_01']=df['PDP_ADDIPV4_01'].astype('str',errors='ignore')
df['PDP_ADDIPV4_01'].dtype
Out[79]: dtype('O')
In [49]: df['PDP_ADDIPV4_01'].dtype
Out[49]: dtype('O')
In [50]: df['PDP_ADDIPV4_01']=df['PDP_ADDIPV4_01'].astype(int,errors='ignore')
df['PDP_ADDIPV4_01'].dtype
Out[50]: dtype('O')
In [51]:
df['PDP_ADDIPV4_01']=df['PDP_ADDIPV4_01'].astype('int',errors='ignore')
df['PDP_ADDIPV4_01'].dtype
Out[51]: dtype('O')
It does not display any error but also it does not change dtype in column. it does not change for integer or string.