๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

Python/Pandas

[Pandas] Dataframe ์ธ๋ฑ์Šค to list ๋ณ€ํ™˜

๋ฐ˜์‘ํ˜•

 

 

 

to_list() ์‚ฌ์šฉ

 

>>> idx = pd.Index([1, 2, 3])
>>> idx
Index([1, 2, 3], dtype='int64')

 

 

>>> idx.to_list()
[1, 2, 3]

 

 

https://pandas.pydata.org/docs/reference/api/pandas.Index.tolist.html

 

pandas.Index.tolist — pandas 2.1.1 documentation

Return the array as an a.ndim-levels deep nested list of Python scalars.

pandas.pydata.org

 

 

 

 

๋ฐ˜์‘ํ˜•