title: Creating new columns using data from a nested column object
body: <p>It's kinda hard to show the dataframe in here, So I uploaded an example csv on the drive.</p>
  <p>Here's the link,
  <a href="https://docs.google.com/spreadsheets/d/19m5hAo3wk9VbBNOyPQ96HhsIrjX20aT8NFwDZkkJRAE/edit?usp=sharing" rel="nofollow noreferrer">https://docs.google.com/spreadsheets/d/19m5hAo3wk9VbBNOyPQ96HhsIrjX20aT8NFwDZkkJRAE/edit?usp=sharing</a></p>
  <p>I want to create n number of bids and asks columns in the dataframe using the data from a dictionary that's inside the depth column of the csv file.</p>
  <p>I tried doing that in a for loop...</p>
  <p>Here's my code,</p>
  <pre><code>total_depth_in_columns = 100
  
  def restructure_data(df):
      
      # Created those new columns
  
      for i in range (total_depth_in_columns):
          df['bid_price_'+str(i+1)] = 0
          df['bid_volume_'+str(i+1)] = 0
          df['ask_price_'+str(i+1)] = 0
          df['ask_volume_'+str(i+1)] = 0
  
  
          
      for i in range(len(df)):
          depth = df['depth'].iloc[i]
  
                 
          # Added data to those columns
              
          for j in range (total_depth_in_columns):
              
              df['bid_price_'+str(j+1)].iloc[i] = depth['bids'][j][0]
              df['bid_volume_'+str(j+1)].iloc[i] = depth['bids'][j][1]
              df['ask_price_'+str(j+1)].iloc[i] = depth['asks'][j][0]
              df['ask_volume_'+str(j+1)].iloc[i] = depth['asks'][j][1]
            
      return df
  </code></pre>
  <p>It works fine when I have around 100 data. But when running this code on 10000+ data, it takes hours to process it. Is there any faster way to do these kind of operations using pandas?</p>