<p>Add train_data 1st</p>

<pre><code>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)
</code></pre>

CC BY-SA 4.0
2020-02-06T15:49:00.593Z
2020-02-06T15:49:00.593Z
estamos
<p>I have created an LSTM Neural Network which take as input the following format in an .csv file</p>

<pre><code>sinewave
0.841470985
0.873736397
0.90255357
0.927808777
0.949402346
0.967249058
0.98127848
0.991435244
</code></pre>

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

<p>eg the following .xlsx file containing 400.000 samples</p>

<pre><code>0xbfb22b18
0xbfb22b14
0xbfb22b10
0xbfb22b0c
0xbfb22b18
0xbfb22b14
0xbfb22b10
0xbfb22b0c
0xbfb22b18
0xbfb22b14
0xbfb22b10
0xbfb22b0c
</code></pre>

<neural-networks><convolutional-neural-networks><recurrent-neural-networks><prediction><time-series>
Convert input dataset given in hex addresses to int
estamos
# Convert input dataset given in hex addresses to int

(Asked by: username_0 on 2020-02-03)

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

**Tags:** neural-networks, convolutional-neural-networks, recurrent-neural-networks, prediction, time-series


---

## 1 answers

### Answer by username_0 on 2020-02-06. Score: 0 | Accepted answer

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)


---

