title: how can I add different size of the values into a pandas data frame at a time
body: <p>I need to fill a data frame gradually. in each step, I have a data like this:</p>
  <pre><code>pubid = 1
  keywords = [2, 2,3]
  </code></pre>
  <p>knowing that the length of values for the column are not equal how can I form a data frame like this:</p>
  <pre><code>pubid   keyword
  1         2
  1         2
  1         3
  </code></pre>
  <p>So next time when the new data is coming and is like this:</p>
  <pre><code>pubid = 6
  keywords = [10, 11]
  </code></pre>
  <p>my data frame becomes:</p>
  <pre><code>pubid   keyword
  1         2
  1         2
  1         3
  6         10
  6         11
  </code></pre>
  <p>I tried to create a temp dataframe at the beginning and add the values like this:</p>
  <pre><code>data = {'pubid': 1, 'keywords':[1]}
  df = pd.DataFrame(data)
  pubid = 3
  keyword = [2, 3]
  df['pubid'] = 3
  df[&quot;keywords&quot;] = df[&quot;pubid&quot;].apply(lambda x: i for i in keyword)
  </code></pre>
  <p>It does not work in this way, but don't know how can I solve it.</p>