<jupyter_start><jupyter_text>Add the directories (Path depends on your machine)<jupyter_code>(pipeline.ingest.ephys.EphysIngest).delete()<jupyter_output>About to delete:
`daveliu_ingestEphys`.`_ephys_ingest`: 757 items
Proceed? [yes, No]: yes
Committed.<jupyter_text>Plotting the behavior data<jupyter_code>import pipeline.ingest.ephys.EphysIngest
dj.ERD(experiment)
import pipeline.ingest.behavior
import pipeline.ephys as ephys
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
session=experiment.Session()
session
animal = 407513
sessionN = 2
behaviorTrial = ephys.experiment.BehaviorTrial()
outcome = (behaviorTrial & {'subject_id': animal} & {'session': sessionN}).fetch('outcome', order_by='session')
early_lick = (behaviorTrial  & {'subject_id': animal} & {'session': sessionN}).fetch('early_lick', order_by='session')
data = np.zeros(len(outcome))
data1 = np.zeros(len(early_lick))
data[outcome=='hit'] = 1
data1[early_lick=='early'] = 1
def movingaverage (values, window):
    weights = np.repeat(1.0, window)/window
    sma = np.convolve(values, weights, 'valid')
    return sma
yMA = movingaverage(data,20)
plt.plot(yMA)
plt.xlabel('Trials')
plt.ylabel('Proportion Correct')
yMA = movingaverage(data1,20)
plt.plot(yMA)
plt.xlabel('Trials')
plt.ylabel('Early Licks')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14177978883861236, 'fraction_numerical': 0.01583710407239819, 'mean_word_length': 7.561290322580645, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '541906', 'license': 'MIT', 'n_tokens_mistral': 509, 'n_tokens_neox': 465, 'n_words': 94, 'path': 'notebook/Analyze Behavior Data.ipynb', 'repo_name': 'Yi-61/map-ephys', 'size': '1326'}