Trial by hx


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


Using matplotlib backend: Qt4Agg

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]:
array(['160321_1', '160321_2', '160321_3', '160325_1', '160325_2',
       '160325_4', '160328_1', '160328_2', '160328_3', '160330_2',
       '160330_3', '160401_1', '160420_1', '160420_2', '160420_3',
       '160421_1', '160421_2', '160421_3', '160428_1', '160429_1',
       '160429_2', '160502_1', '160503_1', '160503_2', '160517_1',
       '160517_2', '160517_3', '160525_1', '160525_2', '160525_3',
       '160620_1', '160620_2', '160620_3', '160621_1', '160621_2',
       '160622_1', '160622_2', '160626_1', '160626_2', '160525', '160614',
       '160615', '160620_4', '160623'], dtype=object)

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]:
array(['MS10'], dtype=object)

In [ ]:


In [ ]:


In [ ]:


In [ ]: