Back

Explore Courses Blog Tutorials Interview Questions
0 votes
4 views
in R Programming by (50.2k points)
Can you please let me know whether we can change an object type variable (containing numbers and special characters) derived from a pandas dataframe to an integer or float type variable.

1 Answer

0 votes
by (108k points)

For that first you need to convert your column data type from object to string and then convert from string to integer:

data_frame['column_name'].astype(str).astype(int)

If you are a beginner and want to know what is R programming, then do refer to the bolg. 

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Browse Categories

...