1
$\begingroup$

I have created an LSTM Neural Network which take as input the following format in an .csv file

sinewave
0.841470985
0.873736397
0.90255357
0.927808777
0.949402346
0.967249058
0.98127848
0.991435244

How can I write some code so it can take as input hex addresses and convert them to int ?

eg the following .xlsx file containing 400.000 samples

0xbfb22b18
0xbfb22b14
0xbfb22b10
0xbfb22b0c
0xbfb22b18
0xbfb22b14
0xbfb22b10
0xbfb22b0c
0xbfb22b18
0xbfb22b14
0xbfb22b10
0xbfb22b0c
$\endgroup$
0
$\begingroup$

Add train_data 1st

import pandas as pd

df = pd.read_excel('data.xlsx', index_col=None, names=['train_data'])
df['train_data'] = df['train_data'].apply(lambda x: int(x, 16))
df.to_csv('data.csv', index=False)
| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.