Skip to content

Instantly share code, notes, and snippets.

@pushpankar
Created April 11, 2018 09:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pushpankar/6bf7b350622e3552ac897d8a4a1ffd20 to your computer and use it in GitHub Desktop.
Save pushpankar/6bf7b350622e3552ac897d8a4a1ffd20 to your computer and use it in GitHub Desktop.
import pandas as pd
df = pd.read_csv("./data.test.pp", sep=" ", header=None, error_bad_lines=False)
df = df.groupby(1)[0].apply(" ".join).reset_index()[[0,1]]
df.to_csv("./multilabelFormat.test.tsv", sep="\t", header=None,
index=False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment