Convert dictionaries with list of values into a dataframeHow to merge two dictionaries in a single expression?How do I sort a list of dictionaries by a value of the dictionary?What is the best way to iterate over a dictionary?Convert two lists into a dictionaryHow do I sort a dictionary by value?Add new keys to a dictionary?Check if a given key already exists in a dictionaryHow do I list all files of a directory?Iterating over dictionaries using 'for' loopsAdding new column to existing DataFrame in Python pandas

Did slaves have slaves?

Do the villains know Batman has no superpowers?

Did HaShem ever command a Navi (Prophet) to break a law?

Dead or alive (First time)

Why is it called a Blood Knot?

Does Mage Hand give away the caster's position?

What is the origin of the "being immortal sucks" trope?

Should I inform my future product owner that there is a good chance that a team member will leave the company soon?

How to ask a man to not take up more than one seat on public transport while avoiding conflict?

Algorithm for competing cells of 0s and 1s

Why are there two bearded faces wearing red hats on my stealth bomber icon?

siunitx redefines macros in pdf bookmarks

Is there an in-universe reason Harry says this or is this simply a Rowling mistake?

What are sources for Magic Items that are not adventure-specific?

Paradox regarding phase transitions in relativistic systems

Other than good shoes and a stick, what are some ways to preserve your knees on long hikes?

Can one guy with a duplicator initiate a nuclear apocalypse?

Is Zack Morris's 'time stop' ability in "Saved By the Bell" a supernatural ability?

Floating Point XOR

What is the maximum viable speed for a projectile within earth's atmosphere?

As a discovery writer, how to complete unfinished novel (which is highly diverted from original plot ) after a time-gap

Integrability of log of distance function

Is there any reason nowadays to use a neon indicator lamp instead of a LED?

What did the controller say during my approach to land (audio clip)?



Convert dictionaries with list of values into a dataframe


How to merge two dictionaries in a single expression?How do I sort a list of dictionaries by a value of the dictionary?What is the best way to iterate over a dictionary?Convert two lists into a dictionaryHow do I sort a dictionary by value?Add new keys to a dictionary?Check if a given key already exists in a dictionaryHow do I list all files of a directory?Iterating over dictionaries using 'for' loopsAdding new column to existing DataFrame in Python pandas






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








6















Say I have three dictionaries



dictionary_col2
'MOB': [1, 2], 'ASP': [1, 2], 'YIP': [1, 2]


 dictionary_col3

'MOB': ['MOB_L001_R1_001.gz',
'MOB_L002_R1_001.gz'],
'ASP': ['ASP_L001_R1_001.gz',
'ASP_L002_R1_001.gz'],
'YIP': ['YIP_L001_R1_001.gz',
'YIP_L002_R1_001.gz']



dictionary_col4

'MOB': ['MOB_L001_R2_001.gz',
'MOB_L002_R2_001.gz'],
'ASP': ['ASP_L001_R2_001.gz',
'ASP_L002_R2_001.gz'],
'YIP': ['YIP_L001_R2_001.gz',
'YIP_L002_R2_001.gz']



I wanna convert the above dictionaries into a data frame. I have tried the following,



df = pd.DataFrame([dictionary_col2, dictionary_col3, dictionary_col4])
The df data frame looks like,



 ASP MOB YIP
0 [1, 2] [1, 2] [1, 2]
1 [ASP_L001_R1_001.gz, ASP_L002_R1_001.gz] [MOB_L001_R1_001.gz, MOB_L002_R1_001.gz] [YIP_L001_R1_001.gz, YIP_L002_R1_001.gz]
2 [ASP_L001_R2_001.gz, ASP_L002_R2_001.gz] [MOB_L001_R2_001.gz, MOB_L002_R2_001.gz] [YIP_L001_R2_001.gz, YIP_L002_R2_001.gz]


My aim is to have a data frame with the following columns:



 col1 col2 col3 col4 
MOB 1 MOB_L001_R1_001.gz MOB_L001_R2_001.gz
MOB 2 MOB_L002_R1_001.gz MOB_L002_R2_001.gz
ASP 1 ASP_L001_R1_001.gz ASP_L001_R2_001.gz
ASP 2 ASP_L002_R1_001.gz MOB_L002_R2_001.gz
YIP 1 YIP_L001_R1_001.gz YIP_L001_R2_001.gz
YIP 2 YIP_L002_R1_001.gz YIP_L002_R2_001.gz


Any help/suggestions are appreciated!!










share|improve this question






























    6















    Say I have three dictionaries



    dictionary_col2
    'MOB': [1, 2], 'ASP': [1, 2], 'YIP': [1, 2]


     dictionary_col3

    'MOB': ['MOB_L001_R1_001.gz',
    'MOB_L002_R1_001.gz'],
    'ASP': ['ASP_L001_R1_001.gz',
    'ASP_L002_R1_001.gz'],
    'YIP': ['YIP_L001_R1_001.gz',
    'YIP_L002_R1_001.gz']



    dictionary_col4

    'MOB': ['MOB_L001_R2_001.gz',
    'MOB_L002_R2_001.gz'],
    'ASP': ['ASP_L001_R2_001.gz',
    'ASP_L002_R2_001.gz'],
    'YIP': ['YIP_L001_R2_001.gz',
    'YIP_L002_R2_001.gz']



    I wanna convert the above dictionaries into a data frame. I have tried the following,



    df = pd.DataFrame([dictionary_col2, dictionary_col3, dictionary_col4])
    The df data frame looks like,



     ASP MOB YIP
    0 [1, 2] [1, 2] [1, 2]
    1 [ASP_L001_R1_001.gz, ASP_L002_R1_001.gz] [MOB_L001_R1_001.gz, MOB_L002_R1_001.gz] [YIP_L001_R1_001.gz, YIP_L002_R1_001.gz]
    2 [ASP_L001_R2_001.gz, ASP_L002_R2_001.gz] [MOB_L001_R2_001.gz, MOB_L002_R2_001.gz] [YIP_L001_R2_001.gz, YIP_L002_R2_001.gz]


    My aim is to have a data frame with the following columns:



     col1 col2 col3 col4 
    MOB 1 MOB_L001_R1_001.gz MOB_L001_R2_001.gz
    MOB 2 MOB_L002_R1_001.gz MOB_L002_R2_001.gz
    ASP 1 ASP_L001_R1_001.gz ASP_L001_R2_001.gz
    ASP 2 ASP_L002_R1_001.gz MOB_L002_R2_001.gz
    YIP 1 YIP_L001_R1_001.gz YIP_L001_R2_001.gz
    YIP 2 YIP_L002_R1_001.gz YIP_L002_R2_001.gz


    Any help/suggestions are appreciated!!










    share|improve this question


























      6












      6








      6


      1






      Say I have three dictionaries



      dictionary_col2
      'MOB': [1, 2], 'ASP': [1, 2], 'YIP': [1, 2]


       dictionary_col3

      'MOB': ['MOB_L001_R1_001.gz',
      'MOB_L002_R1_001.gz'],
      'ASP': ['ASP_L001_R1_001.gz',
      'ASP_L002_R1_001.gz'],
      'YIP': ['YIP_L001_R1_001.gz',
      'YIP_L002_R1_001.gz']



      dictionary_col4

      'MOB': ['MOB_L001_R2_001.gz',
      'MOB_L002_R2_001.gz'],
      'ASP': ['ASP_L001_R2_001.gz',
      'ASP_L002_R2_001.gz'],
      'YIP': ['YIP_L001_R2_001.gz',
      'YIP_L002_R2_001.gz']



      I wanna convert the above dictionaries into a data frame. I have tried the following,



      df = pd.DataFrame([dictionary_col2, dictionary_col3, dictionary_col4])
      The df data frame looks like,



       ASP MOB YIP
      0 [1, 2] [1, 2] [1, 2]
      1 [ASP_L001_R1_001.gz, ASP_L002_R1_001.gz] [MOB_L001_R1_001.gz, MOB_L002_R1_001.gz] [YIP_L001_R1_001.gz, YIP_L002_R1_001.gz]
      2 [ASP_L001_R2_001.gz, ASP_L002_R2_001.gz] [MOB_L001_R2_001.gz, MOB_L002_R2_001.gz] [YIP_L001_R2_001.gz, YIP_L002_R2_001.gz]


      My aim is to have a data frame with the following columns:



       col1 col2 col3 col4 
      MOB 1 MOB_L001_R1_001.gz MOB_L001_R2_001.gz
      MOB 2 MOB_L002_R1_001.gz MOB_L002_R2_001.gz
      ASP 1 ASP_L001_R1_001.gz ASP_L001_R2_001.gz
      ASP 2 ASP_L002_R1_001.gz MOB_L002_R2_001.gz
      YIP 1 YIP_L001_R1_001.gz YIP_L001_R2_001.gz
      YIP 2 YIP_L002_R1_001.gz YIP_L002_R2_001.gz


      Any help/suggestions are appreciated!!










      share|improve this question














      Say I have three dictionaries



      dictionary_col2
      'MOB': [1, 2], 'ASP': [1, 2], 'YIP': [1, 2]


       dictionary_col3

      'MOB': ['MOB_L001_R1_001.gz',
      'MOB_L002_R1_001.gz'],
      'ASP': ['ASP_L001_R1_001.gz',
      'ASP_L002_R1_001.gz'],
      'YIP': ['YIP_L001_R1_001.gz',
      'YIP_L002_R1_001.gz']



      dictionary_col4

      'MOB': ['MOB_L001_R2_001.gz',
      'MOB_L002_R2_001.gz'],
      'ASP': ['ASP_L001_R2_001.gz',
      'ASP_L002_R2_001.gz'],
      'YIP': ['YIP_L001_R2_001.gz',
      'YIP_L002_R2_001.gz']



      I wanna convert the above dictionaries into a data frame. I have tried the following,



      df = pd.DataFrame([dictionary_col2, dictionary_col3, dictionary_col4])
      The df data frame looks like,



       ASP MOB YIP
      0 [1, 2] [1, 2] [1, 2]
      1 [ASP_L001_R1_001.gz, ASP_L002_R1_001.gz] [MOB_L001_R1_001.gz, MOB_L002_R1_001.gz] [YIP_L001_R1_001.gz, YIP_L002_R1_001.gz]
      2 [ASP_L001_R2_001.gz, ASP_L002_R2_001.gz] [MOB_L001_R2_001.gz, MOB_L002_R2_001.gz] [YIP_L001_R2_001.gz, YIP_L002_R2_001.gz]


      My aim is to have a data frame with the following columns:



       col1 col2 col3 col4 
      MOB 1 MOB_L001_R1_001.gz MOB_L001_R2_001.gz
      MOB 2 MOB_L002_R1_001.gz MOB_L002_R2_001.gz
      ASP 1 ASP_L001_R1_001.gz ASP_L001_R2_001.gz
      ASP 2 ASP_L002_R1_001.gz MOB_L002_R2_001.gz
      YIP 1 YIP_L001_R1_001.gz YIP_L001_R2_001.gz
      YIP 2 YIP_L002_R1_001.gz YIP_L002_R2_001.gz


      Any help/suggestions are appreciated!!







      python pandas dictionary






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 9 hours ago









      user1017373user1017373

      8401 gold badge13 silver badges27 bronze badges




      8401 gold badge13 silver badges27 bronze badges

























          4 Answers
          4






          active

          oldest

          votes


















          5
















          pd.DataFrame('col2': pd.DataFrame(col2).unstack(),
          'col3': pd.DataFrame(col3).unstack(),
          'col4': pd.DataFrame(col4).unstack()).reset_index(level=0)


          returns



           level_0 col2 col3 col4
          0 ASP 1 ASP_L001_R1_001.gz ASP_L001_R2_001.gz
          1 ASP 2 ASP_L002_R1_001.gz ASP_L002_R2_001.gz
          0 MOB 1 MOB_L001_R1_001.gz MOB_L001_R2_001.gz
          1 MOB 2 MOB_L002_R1_001.gz MOB_L002_R2_001.gz
          0 YIP 1 YIP_L001_R1_001.gz YIP_L001_R2_001.gz
          1 YIP 2 YIP_L002_R1_001.gz YIP_L002_R2_001.gz





          share|improve this answer

























          • This solution best works for my question as it generates the column name as well. Thank you!

            – user1017373
            8 hours ago


















          4
















          dict_list = [dictionary_col2, dictionary_col3, dictionary_col4]

          df = pd.concat([pd.DataFrame.from_dict(x, orient = 'index').unstack() for x in dict_list], axis = 1)


          output:



          >>> df

          0 1 2
          0 MOB 1 MOB_L001_R1_001.gz MOB_L001_R2_001.gz
          ASP 1 ASP_L001_R1_001.gz ASP_L001_R2_001.gz
          YIP 1 YIP_L001_R1_001.gz YIP_L001_R2_001.gz
          1 MOB 2 MOB_L002_R1_001.gz MOB_L002_R2_001.gz
          ASP 2 ASP_L002_R1_001.gz ASP_L002_R2_001.gz
          YIP 2 YIP_L002_R1_001.gz YIP_L002_R2_001.gz





          share|improve this answer

























          • Thank you for the solution

            – user1017373
            8 hours ago


















          3
















          IIUC, you can do:



          pd.concat([pd.DataFrame(d).stack() for d in (d1,d2,d3)], axis=1)


          Output:



           0 1 2
          0 MOB 1 MOB_L001_R1_001.gz MOB_L001_R2_001.gz
          ASP 1 ASP_L001_R1_001.gz ASP_L001_R2_001.gz
          YIP 1 YIP_L001_R1_001.gz YIP_L001_R2_001.gz
          1 MOB 2 MOB_L002_R1_001.gz MOB_L002_R2_001.gz
          ASP 2 ASP_L002_R1_001.gz ASP_L002_R2_001.gz
          YIP 2 YIP_L002_R1_001.gz YIP_L002_R2_001.gz





          share|improve this answer

























          • Thank you for the solution

            – user1017373
            8 hours ago


















          2
















          What you can do using concat with explode notice in pandas 0.25.0



          pd.concat([pd.Series(x).explode() for x in [d1,d2]],axis=1)





          share|improve this answer



























          • Thanks for your time!

            – user1017373
            8 hours ago













          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );














          draft saved

          draft discarded
















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f57975706%2fconvert-dictionaries-with-list-of-values-into-a-dataframe%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          4 Answers
          4






          active

          oldest

          votes








          4 Answers
          4






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          5
















          pd.DataFrame('col2': pd.DataFrame(col2).unstack(),
          'col3': pd.DataFrame(col3).unstack(),
          'col4': pd.DataFrame(col4).unstack()).reset_index(level=0)


          returns



           level_0 col2 col3 col4
          0 ASP 1 ASP_L001_R1_001.gz ASP_L001_R2_001.gz
          1 ASP 2 ASP_L002_R1_001.gz ASP_L002_R2_001.gz
          0 MOB 1 MOB_L001_R1_001.gz MOB_L001_R2_001.gz
          1 MOB 2 MOB_L002_R1_001.gz MOB_L002_R2_001.gz
          0 YIP 1 YIP_L001_R1_001.gz YIP_L001_R2_001.gz
          1 YIP 2 YIP_L002_R1_001.gz YIP_L002_R2_001.gz





          share|improve this answer

























          • This solution best works for my question as it generates the column name as well. Thank you!

            – user1017373
            8 hours ago















          5
















          pd.DataFrame('col2': pd.DataFrame(col2).unstack(),
          'col3': pd.DataFrame(col3).unstack(),
          'col4': pd.DataFrame(col4).unstack()).reset_index(level=0)


          returns



           level_0 col2 col3 col4
          0 ASP 1 ASP_L001_R1_001.gz ASP_L001_R2_001.gz
          1 ASP 2 ASP_L002_R1_001.gz ASP_L002_R2_001.gz
          0 MOB 1 MOB_L001_R1_001.gz MOB_L001_R2_001.gz
          1 MOB 2 MOB_L002_R1_001.gz MOB_L002_R2_001.gz
          0 YIP 1 YIP_L001_R1_001.gz YIP_L001_R2_001.gz
          1 YIP 2 YIP_L002_R1_001.gz YIP_L002_R2_001.gz





          share|improve this answer

























          • This solution best works for my question as it generates the column name as well. Thank you!

            – user1017373
            8 hours ago













          5














          5










          5









          pd.DataFrame('col2': pd.DataFrame(col2).unstack(),
          'col3': pd.DataFrame(col3).unstack(),
          'col4': pd.DataFrame(col4).unstack()).reset_index(level=0)


          returns



           level_0 col2 col3 col4
          0 ASP 1 ASP_L001_R1_001.gz ASP_L001_R2_001.gz
          1 ASP 2 ASP_L002_R1_001.gz ASP_L002_R2_001.gz
          0 MOB 1 MOB_L001_R1_001.gz MOB_L001_R2_001.gz
          1 MOB 2 MOB_L002_R1_001.gz MOB_L002_R2_001.gz
          0 YIP 1 YIP_L001_R1_001.gz YIP_L001_R2_001.gz
          1 YIP 2 YIP_L002_R1_001.gz YIP_L002_R2_001.gz





          share|improve this answer













          pd.DataFrame('col2': pd.DataFrame(col2).unstack(),
          'col3': pd.DataFrame(col3).unstack(),
          'col4': pd.DataFrame(col4).unstack()).reset_index(level=0)


          returns



           level_0 col2 col3 col4
          0 ASP 1 ASP_L001_R1_001.gz ASP_L001_R2_001.gz
          1 ASP 2 ASP_L002_R1_001.gz ASP_L002_R2_001.gz
          0 MOB 1 MOB_L001_R1_001.gz MOB_L001_R2_001.gz
          1 MOB 2 MOB_L002_R1_001.gz MOB_L002_R2_001.gz
          0 YIP 1 YIP_L001_R1_001.gz YIP_L001_R2_001.gz
          1 YIP 2 YIP_L002_R1_001.gz YIP_L002_R2_001.gz






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 9 hours ago









          eumiroeumiro

          142k22 gold badges247 silver badges238 bronze badges




          142k22 gold badges247 silver badges238 bronze badges















          • This solution best works for my question as it generates the column name as well. Thank you!

            – user1017373
            8 hours ago

















          • This solution best works for my question as it generates the column name as well. Thank you!

            – user1017373
            8 hours ago
















          This solution best works for my question as it generates the column name as well. Thank you!

          – user1017373
          8 hours ago





          This solution best works for my question as it generates the column name as well. Thank you!

          – user1017373
          8 hours ago













          4
















          dict_list = [dictionary_col2, dictionary_col3, dictionary_col4]

          df = pd.concat([pd.DataFrame.from_dict(x, orient = 'index').unstack() for x in dict_list], axis = 1)


          output:



          >>> df

          0 1 2
          0 MOB 1 MOB_L001_R1_001.gz MOB_L001_R2_001.gz
          ASP 1 ASP_L001_R1_001.gz ASP_L001_R2_001.gz
          YIP 1 YIP_L001_R1_001.gz YIP_L001_R2_001.gz
          1 MOB 2 MOB_L002_R1_001.gz MOB_L002_R2_001.gz
          ASP 2 ASP_L002_R1_001.gz ASP_L002_R2_001.gz
          YIP 2 YIP_L002_R1_001.gz YIP_L002_R2_001.gz





          share|improve this answer

























          • Thank you for the solution

            – user1017373
            8 hours ago















          4
















          dict_list = [dictionary_col2, dictionary_col3, dictionary_col4]

          df = pd.concat([pd.DataFrame.from_dict(x, orient = 'index').unstack() for x in dict_list], axis = 1)


          output:



          >>> df

          0 1 2
          0 MOB 1 MOB_L001_R1_001.gz MOB_L001_R2_001.gz
          ASP 1 ASP_L001_R1_001.gz ASP_L001_R2_001.gz
          YIP 1 YIP_L001_R1_001.gz YIP_L001_R2_001.gz
          1 MOB 2 MOB_L002_R1_001.gz MOB_L002_R2_001.gz
          ASP 2 ASP_L002_R1_001.gz ASP_L002_R2_001.gz
          YIP 2 YIP_L002_R1_001.gz YIP_L002_R2_001.gz





          share|improve this answer

























          • Thank you for the solution

            – user1017373
            8 hours ago













          4














          4










          4









          dict_list = [dictionary_col2, dictionary_col3, dictionary_col4]

          df = pd.concat([pd.DataFrame.from_dict(x, orient = 'index').unstack() for x in dict_list], axis = 1)


          output:



          >>> df

          0 1 2
          0 MOB 1 MOB_L001_R1_001.gz MOB_L001_R2_001.gz
          ASP 1 ASP_L001_R1_001.gz ASP_L001_R2_001.gz
          YIP 1 YIP_L001_R1_001.gz YIP_L001_R2_001.gz
          1 MOB 2 MOB_L002_R1_001.gz MOB_L002_R2_001.gz
          ASP 2 ASP_L002_R1_001.gz ASP_L002_R2_001.gz
          YIP 2 YIP_L002_R1_001.gz YIP_L002_R2_001.gz





          share|improve this answer













          dict_list = [dictionary_col2, dictionary_col3, dictionary_col4]

          df = pd.concat([pd.DataFrame.from_dict(x, orient = 'index').unstack() for x in dict_list], axis = 1)


          output:



          >>> df

          0 1 2
          0 MOB 1 MOB_L001_R1_001.gz MOB_L001_R2_001.gz
          ASP 1 ASP_L001_R1_001.gz ASP_L001_R2_001.gz
          YIP 1 YIP_L001_R1_001.gz YIP_L001_R2_001.gz
          1 MOB 2 MOB_L002_R1_001.gz MOB_L002_R2_001.gz
          ASP 2 ASP_L002_R1_001.gz ASP_L002_R2_001.gz
          YIP 2 YIP_L002_R1_001.gz YIP_L002_R2_001.gz






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 9 hours ago









          Brian JosephBrian Joseph

          7162 silver badges13 bronze badges




          7162 silver badges13 bronze badges















          • Thank you for the solution

            – user1017373
            8 hours ago

















          • Thank you for the solution

            – user1017373
            8 hours ago
















          Thank you for the solution

          – user1017373
          8 hours ago





          Thank you for the solution

          – user1017373
          8 hours ago











          3
















          IIUC, you can do:



          pd.concat([pd.DataFrame(d).stack() for d in (d1,d2,d3)], axis=1)


          Output:



           0 1 2
          0 MOB 1 MOB_L001_R1_001.gz MOB_L001_R2_001.gz
          ASP 1 ASP_L001_R1_001.gz ASP_L001_R2_001.gz
          YIP 1 YIP_L001_R1_001.gz YIP_L001_R2_001.gz
          1 MOB 2 MOB_L002_R1_001.gz MOB_L002_R2_001.gz
          ASP 2 ASP_L002_R1_001.gz ASP_L002_R2_001.gz
          YIP 2 YIP_L002_R1_001.gz YIP_L002_R2_001.gz





          share|improve this answer

























          • Thank you for the solution

            – user1017373
            8 hours ago















          3
















          IIUC, you can do:



          pd.concat([pd.DataFrame(d).stack() for d in (d1,d2,d3)], axis=1)


          Output:



           0 1 2
          0 MOB 1 MOB_L001_R1_001.gz MOB_L001_R2_001.gz
          ASP 1 ASP_L001_R1_001.gz ASP_L001_R2_001.gz
          YIP 1 YIP_L001_R1_001.gz YIP_L001_R2_001.gz
          1 MOB 2 MOB_L002_R1_001.gz MOB_L002_R2_001.gz
          ASP 2 ASP_L002_R1_001.gz ASP_L002_R2_001.gz
          YIP 2 YIP_L002_R1_001.gz YIP_L002_R2_001.gz





          share|improve this answer

























          • Thank you for the solution

            – user1017373
            8 hours ago













          3














          3










          3









          IIUC, you can do:



          pd.concat([pd.DataFrame(d).stack() for d in (d1,d2,d3)], axis=1)


          Output:



           0 1 2
          0 MOB 1 MOB_L001_R1_001.gz MOB_L001_R2_001.gz
          ASP 1 ASP_L001_R1_001.gz ASP_L001_R2_001.gz
          YIP 1 YIP_L001_R1_001.gz YIP_L001_R2_001.gz
          1 MOB 2 MOB_L002_R1_001.gz MOB_L002_R2_001.gz
          ASP 2 ASP_L002_R1_001.gz ASP_L002_R2_001.gz
          YIP 2 YIP_L002_R1_001.gz YIP_L002_R2_001.gz





          share|improve this answer













          IIUC, you can do:



          pd.concat([pd.DataFrame(d).stack() for d in (d1,d2,d3)], axis=1)


          Output:



           0 1 2
          0 MOB 1 MOB_L001_R1_001.gz MOB_L001_R2_001.gz
          ASP 1 ASP_L001_R1_001.gz ASP_L001_R2_001.gz
          YIP 1 YIP_L001_R1_001.gz YIP_L001_R2_001.gz
          1 MOB 2 MOB_L002_R1_001.gz MOB_L002_R2_001.gz
          ASP 2 ASP_L002_R1_001.gz ASP_L002_R2_001.gz
          YIP 2 YIP_L002_R1_001.gz YIP_L002_R2_001.gz






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 9 hours ago









          Quang HoangQuang Hoang

          17.6k2 gold badges14 silver badges27 bronze badges




          17.6k2 gold badges14 silver badges27 bronze badges















          • Thank you for the solution

            – user1017373
            8 hours ago

















          • Thank you for the solution

            – user1017373
            8 hours ago
















          Thank you for the solution

          – user1017373
          8 hours ago





          Thank you for the solution

          – user1017373
          8 hours ago











          2
















          What you can do using concat with explode notice in pandas 0.25.0



          pd.concat([pd.Series(x).explode() for x in [d1,d2]],axis=1)





          share|improve this answer



























          • Thanks for your time!

            – user1017373
            8 hours ago















          2
















          What you can do using concat with explode notice in pandas 0.25.0



          pd.concat([pd.Series(x).explode() for x in [d1,d2]],axis=1)





          share|improve this answer



























          • Thanks for your time!

            – user1017373
            8 hours ago













          2














          2










          2









          What you can do using concat with explode notice in pandas 0.25.0



          pd.concat([pd.Series(x).explode() for x in [d1,d2]],axis=1)





          share|improve this answer















          What you can do using concat with explode notice in pandas 0.25.0



          pd.concat([pd.Series(x).explode() for x in [d1,d2]],axis=1)






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 8 hours ago

























          answered 9 hours ago









          WeNYoBenWeNYoBen

          159k8 gold badges55 silver badges86 bronze badges




          159k8 gold badges55 silver badges86 bronze badges















          • Thanks for your time!

            – user1017373
            8 hours ago

















          • Thanks for your time!

            – user1017373
            8 hours ago
















          Thanks for your time!

          – user1017373
          8 hours ago





          Thanks for your time!

          – user1017373
          8 hours ago


















          draft saved

          draft discarded















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f57975706%2fconvert-dictionaries-with-list-of-values-into-a-dataframe%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown