In [2]:
import pandas as pd
from pathlib import Path

In [3]:
filename = Path('csv/comma_delimited/HeLaL_Control_1.csv')

In [4]:
df = pd.read_csv(filename)

In [5]:
df


Out[5]:
x y z frame uncertainty intensity offset loglikelihood sigma
0 6770.0 59386 0 50 9.5138 4386.6 270.24 425.92 218.79
1 7958.1 59762 0 50 6.7329 8310.3 562.65 619.47 199.50
2 7840.8 60819 0 50 2.1987 15671.0 1261.10 1691.40 119.47
3 8090.2 59801 0 50 7.6282 6952.3 642.53 506.19 206.46
4 9010.3 59647 0 50 6.5814 8408.1 684.29 821.24 197.90
5 9163.2 60771 0 50 2.5165 13696.0 1161.70 1307.20 124.29
6 9821.6 57925 0 50 6.1704 8527.4 499.46 603.25 199.65
7 9899.9 56713 0 50 10.8830 3107.8 341.58 243.08 191.90
8 9833.3 57936 0 50 6.5072 8247.5 518.02 643.07 204.34
9 10203.0 62858 0 50 6.1123 8569.2 641.58 732.65 198.22
10 10350.0 58521 0 50 1.0787 35038.0 1346.00 12727.00 111.56

In [7]:
outputfile = Path('json/columns/HeLaL_Control_1.json')
df.to_json(str(outputfile), orient='columns')

outputfile = Path('json/index/HeLaL_Control_1.json')
df.to_json(str(outputfile), orient='index')

In [11]:
df2=pd.read_json(str(outputfile), orient='index')

In [13]:
len(df2.columns)


Out[13]:
9

In [ ]: