In [1]:
drive_path = 'c:/'
import numpy as np
import pandas as pd
import os
import sys
import matplotlib.pyplot as plt
from scipy.stats import ks_2samp
from scipy.stats import anderson_ksamp
from scipy.stats import kruskal
from scipy.stats import variation
%matplotlib
import seaborn as sns
from scipy.stats import zscore
from scipy.stats import nanmean
from scipy.stats import nanstd
In [2]:
filename='C:\Users\Annie\Documents\Data\Ca_Imaging\GoodFiles\\fullpeak.csv'
comp=pd.read_csv(filename)
comp_sorted=comp.reindex_axis(comp.mean().sort_values().index, axis=1)
comp_labels=pd.DataFrame(comp.Mouse)
comp_group=pd.DataFrame(comp.Group)
tmp=[comp_group,comp_labels,comp_sorted]
composite_full=pd.concat(tmp,axis=1)
cfull=pd.melt(composite_full,['Group','Mouse'],var_name="Odor")
In [13]:
test=pd.read_csv('C:\Users\Annie\Documents\Data\Ca_Imaging\GoodFiles\\160325_1\\9dt.txt')
In [18]:
trials=pd.read_csv('C:\\Users\\Annie\\Documents\\Data\\Ca_Imaging\\Analysis\\Odor_Panel\\Odor_Trials.csv')
In [128]:
trials.File.unique()
Out[128]:
In [39]:
In [98]:
In [166]:
#Order all the trials
# for a in trials.File.unique():
temp=trials[trials.File==a]
tone=temp[['Odor','T1']]
tone.columns=['Odor','Trial']
ttwo=temp[['Odor','T2']]
ttwo.columns=['Odor','Trial']
tthree=temp[['Odor','T3']]
tthree.columns=['Odor','Trial']
tfour=temp[['Odor','T4']]
tfour.columns=['Odor','Trial']
trialsdf=pd.concat([tone,ttwo,tthree,tfour],axis=0,ignore_index=True)
sortedtrials=trialsdf.sort_values('Trial')
sortedtrials=sortedtrials[sortedtrials.Trial!=0]
#Get Odor1 and Odor2
TH=pd.DataFrame([])
for x in sortedtrials.Trial.unique():
if x<len(sortedtrials.Trial.unique()):
Odor1=sortedtrials[sortedtrials.Trial==x]['Odor'].values
Odor2=sortedtrials[sortedtrials.Trial==x+1]['Odor'].values
tmp=({'Mouse':a,'Odor1':Odor1,'Odor2':Odor2,'Trial1':x,'Trial2':x+1})
TH=TH.append(tmp,ignore_index=True)
In [168]:
#WHY IS X NOT CHANGING BACK TO INT& WHY CAN I NOT GET ODOR 1 valuess
Out[168]:
In [ ]:
In [ ]:
In [ ]:
In [ ]: