title: How to export original CSV columns, alongside Bigram count and frequency to new csv?
body: <p>This is one of my first times using Python so apologies if this is a silly question. I have a 3 column CSV, first column called comment (which is the column that I manipulated into bigrams), second column which is called comment type, and third column which is called comment date. I am satisfied with my current output from this code, where I split column 1 (Comment) into bigrams, counted the frequencies, and exported into a CSV file. But now I also want to add the comment type and comment date columns from my original csv (without making any changes to them) to my exported CSV next to word and frequency columns. I'm not to sure how to go about that and tested some ideas but didn't work.</p>
  
  <pre><code>import csv
  import string
  import re
  from nltk.util import everygrams
  import pandas as pd
  
  
  from collections import Counter
  
  from itertools import combinations
  
  df = pd.read_csv('modified.csv', 'r', encoding="utf8",
                   names=['comment'])
  top_N = 1000
  stopwords = nltk.corpus.stopwords.words('english')
  
  RE_stopwords = r'\b(?:{})\b'.format('|'.join(stopwords))
  
  txt = df.comment.str.lower().str.replace(r'\|', ' ').str.cat(sep=' ')
  
  words = nltk.tokenize.word_tokenize(txt)
  words = [w for w in words if not w in RE_stopwords]
  
  bigrm = list(nltk.bigrams(words))
  
  
  
  word_dist = nltk.FreqDist([' '.join(x) for x in bigrm])
  rslt = pd.DataFrame(word_dist.most_common(top_N),
                  columns=['Word', 'Frequency'])
  
  print(rslt)
  rslt.to_csv('bigram3.csv')
  </code></pre>