How to get DataFrame index without RDD conversion?

0

Hi, I'm trying to iterate through the results returned from SelectFields action using the following command

SelectFields_node1656679636429.toDF().index

but i get the following error

AttributeError: 'DataFrame' object has no attribute 'index' it appears that even I convert the DynamicFrame to DataFrame, many attributes are missing. I found a workaround using RDD, and re-inialising a new DataFrame, like below

rdd = SelectFields_node1656679636429.toDF().rdd
df = pd.DataFrame(rdd.collect())
df.index

but this approach seems an overhead. Are there any better, native ways of getting the properly initialized DataFrame from DynamicFrame?

Michael
質問済み 2年前64ビュー
回答なし

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ