Skip to content
Snippets Groups Projects
Commit 268076cc authored by Alexandros Asonitis's avatar Alexandros Asonitis
Browse files

save data

parent 5066e2a6
No related branches found
No related tags found
No related merge requests found
%% Cell type:code id:d119393c-bc09-4646-a812-d17081d0d105 tags:
``` python
import hp4155a
```
%% Cell type:code id:af3fb977-e43b-4120-9e76-8924c8e24d7c tags:
``` python
device = hp4155a.HP4155a('GPIB0::17::INSTR')
```
%% Cell type:code id:ed0d34d0-da93-4f68-8c71-159d47b32347 tags:
``` python
time = device.return_values("@TIME")
```
%% Cell type:code id:fa4ce64d-fb66-407b-bcfb-fe1faeca2df9 tags:
``` python
R = device.return_values("R")
```
%% Cell type:code id:dbf0d611-d5a6-49f2-9fc4-e1df92c2a5c1 tags:
``` python
data = {"time(s)":time,"R(Ohm)":R}
```
%% Cell type:code id:25ba9dff-dfa6-4a2d-8a68-d39e36bd9651 tags:
``` python
import pandas as pd
```
%% Cell type:code id:977fab8d-7664-4f7d-817c-45f53b2544cc tags:
``` python
df = pd.DataFrame(data)
```
%% Cell type:code id:81f38ff3-0d53-4730-ae4c-d187e23a5f58 tags:
``` python
print(df)
```
%% Output
time(s) R(Ohm)
0 0.0 2.514458e+07
1 60.0 3.031222e+07
2 120.0 3.103662e+07
3 180.0 3.669725e+07
4 240.0 3.880481e+07
.. ... ...
846 50760.0 -5.347594e+08
847 50820.0 2.450980e+08
848 50880.0 -2.325581e+09
849 50940.0 -5.154639e+08
850 51000.0 -9.259259e+08
[851 rows x 2 columns]
%% Cell type:code id:af5de74d-307a-4530-8b63-3fc7f974c7dc tags:
``` python
with open('Retention data Bor-Han.txt',"w") as f:
f.write(df.to_string())
```
%% Cell type:code id:edfa472e-39d6-41cd-b771-a70904207528 tags:
``` python
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment