Skip to article frontmatterSkip to article content

Data preprocessing for manual segmentation data

Import libraries

import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import friends_pack

Convert your data into a dataframe

df_manual_seg = friends_pack.tsv_to_df2("../friends_annotations/annotation_results/manual_segmentation")

Add rows for analyses

df_manual_seg['global_segment'] = df_manual_seg.index + 1
df_manual_seg["episode_full"] = df_manual_seg["episode"].str[:-1]
df_manual_seg
Loading...

get some description of the dataframe

df_manual_seg.describe()
Loading...

save your dataframe into a tsv

df_manual_seg.to_csv("../output/manual_segmentation_all.tsv", sep="\t", index=False)