Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

save list to dataframe pandas

import pandas as pd
list_name = ['item_1', 'item_2', 'item_3',...]
df = pd.DataFrame (list_name, columns = ['column_name'])
Comment

pandas save dataframe with list

"""
  write/read your pandas.DataFrame as a pickle (.pkl) file
  to keep the list data structure
"""

# write
df.to_pickle('path/to/filename.pkl')

# read
df.read_picke('path/to/filename.pkl')
Comment

PREVIOUS NEXT
Code Example
Python :: how to store categorical variables in separate dataframe 
Python :: Python list function tutorial 
Python :: replace nan from another column 
Python :: Find the path of python executable 
Python :: f string python 
Python :: Remove an element from a Python list Using remove() method 
Python :: iterating string in python 
Python :: cool python imports 
Python :: numpy datatime object 
Python :: drop columns pandas dataframe 
Python :: python minimum 
Python :: length of list in python 
Python :: polls/models.py 
Python :: merge sorting in python 
Python :: input() function in python 
Python :: assert python 3 
Python :: rotate matrix 90 degrees clockwise in python 
Python :: dfs algorithm python 
Python :: python unbound variable 
Python :: for _ in range() in python 
Python :: gui in python 
Python :: print integer python 
Python :: comparison python 
Python :: python syntaxerror: unexpected character after line continuation character 
Python :: interpreter in python 
Python :: what are for loops 
Python :: new line eval python 
Python :: how to count the iteration a list python 
Python :: landscape odoo report 
Python :: export ifc dataframe python 
ADD CONTENT
Topic
Content
Source link
Name
1+4 =