<jupyter_start><jupyter_text>Python - Create dataframe from lists **Tags:** python list dataframe snippet pandas **Author:** [<NAME>](https://www.linkedin.com/in/ACoAABCNSioBW3YZHc2lBHVG0E_TXYWitQkmwog/) Here below you will find how to create a pandas DataFrame from two lists in Python.  Input  Import libraries<jupyter_code>import pandas as pd<jupyter_output><empty_output><jupyter_text>Variables<jupyter_code># Setup your columns name
col_key = "KEYS"
col_value = "VALUE"<jupyter_output><empty_output><jupyter_text>Lists<jupyter_code>keys = [1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012]
value = [219, 146, 112, 127, 124, 180, 236, 207, 236, 263, 350, 430, 474, 526, 488, 537, 500, 439]<jupyter_output><empty_output><jupyter_text>Model  Create zip iterator<jupyter_code># Call zip(iter1, iter2) with one list as iter1 and another list as iter2 to create a zip iterator containing pairs of elements from the two lists.
zip_iterators = zip(keys, value)<jupyter_output><empty_output><jupyter_text>Output  Create dataframe<jupyter_code>df = pd.DataFrame(zip_iterators, columns=[col_key, col_value])
df<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1115771812080537, 'fraction_numerical': 0.1115771812080537, 'mean_word_length': 7.521428571428571, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 22, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '67117', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 552, 'n_tokens_neox': 415, 'n_words': 118, 'path': 'Python/Python_Create_dataframe_from_lists.ipynb', 'repo_name': 'srini047/awesome-notebooks', 'size': '1201'}