python - convert function code example
Example 1: how to convert types of variablesin python
int(anyData)
str(anyData)
ord(chr)
hex(int)
oct(int)
float(anyData)
tuple()
set()
list()
dict()
complex(real,imag)
Example 2: python: convert variable as character
df['myvar'] = df['myvar'].astype(str)
Example 3: python data type conversion
equationStrToInt = '8 * 8'
eval(equationStrToInt)
type(equationStrToInt)
print(equationStrToInt)
strToList = 'GREPPER'
list(strToList)
type(strToList)
print(strToList)