Pyspark, Finite Element Analysis, Mathematical Modeling, Databricks.
number_of_local_nodes + 1 # Create index dataframe index_df = (spark.range(1, N2 + 1) .crossJoin(spark.range(1, N2 + 1)) .crossJoin(spark.range(1, number_of_local_nodes + 1)) .toDF("row", "column", "alpha") .withColumn("n1", (col("column") - 1) * (2 * N2) + 2 * col("row") - 2) .withColumn("n2",