Is there a way to CONCAT two dataframes on either of the axis (row/column) and transpose the dataframe in PySpark?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2022 07:21 PM
I'm reshaping my dataframe as per requirement and I came across this situation where I'm concatenating 2 dataframes and then transposing them. I've done this previously using pandas and the syntax for pandas goes as below:
import pandas as pd
df1 = pd.DataFrame(some_dict)
df2 = pd.DataFrame(some_dict)
new_df = pd.concat( [df1, df2], axis = "column") #stacking the dfs side by side
trans_df = new_df.transpose() or simply new_df.TIs there a way I could do this in PySpark? Any leads would be greatly appreciated.
Riz
Labels:
- Labels:
-
Pyspark