example of how to load data


In [52]:
# modules
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
%matplotlib inline
# files
#list_of_files = !ls *.txt
list_of_files = !ls ../../pH7.03/CEST/*.txt
n = len(list_of_files)

In [53]:
# empty dataframe
CEST_data = np.zeros((101,n))
df = pd.DataFrame(CEST_data)
df.columns = list_of_files

In [60]:
for file in list_of_files:
    Z = pd.read_csv(file, header = None)
    df[file] = Z.values[4:] / Z.values[-1]
df[df.columns[-1]] = pd.read_csv('ppm.txt', header = None).values[4:]
df = df.set_index(df.columns[-1])

In [61]:
df.to_csv('All_data.csv')

In [62]:
df.plot()


Out[62]:
<matplotlib.axes._subplots.AxesSubplot at 0x1148b6f28>

In [ ]: