title: Pandas with different length arrays
body: <p>This is the code I have. Due to content of the raw data to be parsed, I end up with the 'user list' and the 'tweet list' being of different length. When writing the lists as columns in a data frame, I get <code>ValueError: arrays must all be same length</code>. I realize this, but have been looking for a way to work around it, printing <code>0</code> or <code>NaN</code> in the right places of the shorter array. Any ideas? </p>
  
  <pre><code>import pandas
  from bs4 import BeautifulSoup
  soup = BeautifulSoup(open('#raw.html'))
  chunk = soup.find_all('div', class_='content')
  
  userlist = []
  tweetlist = []
  
  for tweet in chunk:
      username = tweet.find_all(class_='username js-action-profile-name')
      for user in username:
          user2 = user.get_text()
          userlist.append(user2)
  
  for text in chunk:
      tweets = text.find_all(class_='js-tweet-text tweet-text')
  for tweet in tweets:
      tweet2 = tweet.get_text().encode('utf-8')
      tweetlist.append('|'+tweet2)
  
  print len(tweetlist)
  print len(userlist)
  
  #MAKE A DATAFRAME WITH THIS
  data = {'tweet' : tweetlist, 'user' : userlist}
  frame = pandas.DataFrame(data)
  print frame
  
  # Export dataframe to csv
  frame.to_csv('#parsed.csv', index=False)
  </code></pre>