[英]How do I access the 'hidden' index in my array? (Python)
這是我原來的 dataframe 的樣子:
上述dataframe的第0列對應foracid列
foracid
在對這些數據進行子集化並將其輸入到 model 之后,我想要關聯回原始 dataframe 的 output 如下所示:
這里的左列與原始dataframe的year_month列有關,但第0列是右列。 信息顯然在那里,我想知道如何獲得這些year_month值,以便將其與原始 dataframe 相關聯。
year_month
任何幫助深表感謝!
如果您正在查看的值在 dataframe 的index值中使用,那么您需要:
index
df = df.reset_index()
這將創建一個從 0 到 n 的新索引以及一個帶有該索引的新列。
[英]How do I access my webcam in Python?
[英]How do I access a numpy array using the memory index?
[英]How do I access the index of items inside an array that is inside a dictionary?
[英]How do I make my python program get the index of a string?
[英]How do I return the index of the target element in a Python array?
[英]How do I index an item in a JSON array from Python
[英]How do I use a variable as an array index in Python?
[英]how do I get a specific index within an array in python?
[英]How do I access an array elements from my class in a for loop
[英]How do I access the webpage that my Python script makes?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.