Skip to content

Instantly share code, notes, and snippets.

@yogenderPalChandra
Created July 3, 2022 09:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yogenderPalChandra/f2aa61798bca34745434e5c3d298c3b3 to your computer and use it in GitHub Desktop.
Save yogenderPalChandra/f2aa61798bca34745434e5c3d298c3b3 to your computer and use it in GitHub Desktop.
def rdd_df_2_pd_df(rdd_df):
""" changes the name of rdd rows to more identifiable name - cost
returns pandas df
"""
row = Row("cost")
match_df_flat1_df= rdd_df.map(row).toDF()
return match_df_flat1_df.toPandas()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment