how to make string to int in python
string = "324501763"
integer = int(string)
how to make string to int in python
string = "324501763"
integer = int(string)
encoding character or string to integer in python
note:text contains your string or already read textfile
import numpy as np
text = 'hello'
vocab=sorted(set(text))
char_to_ind = {char:ind for ind,char in enumerate(vocab)}
encoded_text = np.array([char_to_ind[c]for c in text])
your string has been encoded
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us