Resolved: Casting string data to integer
in
Data Preprocessing with NumPy
/
Manipulating Text Data: Converting Strings and Creating a Checkpoint
hi !
I have some doubts.
I think earlier it was said that -
We can't directly cast strings to integers.
We can go through floats (string-> float -> integer).
but here in the video , the data is directly converted to integers.
Why I'm getting the value error ?
please check the screenshot of jupyter notebook attached below
1 answers ( 1 marked as helpful)
In your string array there is 'Sep' which cannot be converted to an integer, and also I think they meant that we can't always cast strings into integers, we only can cast them into integers when we are sure that we don"t have any non-numeric character in he string.