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 :: for i 
Python :: pandas length of dataframe 
Python :: django save image 
Python :: how to cout in python 
Python :: django get form data from post 
Python :: convert all images in folder to jpg python 
Python :: how to sort a dictionary using pprint module in python 
Python :: correlation between images python 
Python :: python how to draw a square 
Python :: iter() python 
Python :: python replace by dictionary 
Python :: python series to list of string 
Python :: how to display printed values without scientific notation python 
Python :: django queryset last 10 
Python :: how to convert into grayscale opencv 
Python :: vscode pylint missing module docstring 
Python :: leap year python 
Python :: how do i turn a tensor into a numpy array 
Python :: how does urllib.parse.urlsplit work in python 
Python :: check if point is inside polygon python 
Python :: Accessing elements from a Python Dictionary 
Python :: python get list of file and time created 
Python :: flask remove file after send_file 
Python :: twitter api v2 python tweepy 
Python :: dataframe time index convert tz naive to tz aware 
Python :: how to run pyttsx3 in a loop 
Python :: python print datetime 
Python :: open word from python 
Python :: python get all combinations of list 
Python :: how to change the values of a column in numpy array 
ADD CONTENT
Topic
Content
Source link
Name
7+7 =