How to split a CSV into a dataframe without newline Currently I'm using pyspark to make my df from a csv. However when I take the data in, it puts each element on a new line. Is there any way to keep the elements separate, and keep them on the same line?

#Loads the data in the textfile
df = sc.textFile("data.csv").map(lambda line: line.split(","))
df.take(1)

[['2',

  '20200118',

  '0',

  'AE',

  'ABV',

  'AUH',

  '20200416',

  '0',
You actually have a matrix, all items are grouped by row.

A very small example:

csv:
a,b
c,d


Will become:

[['a','b'],['c','d']]


The formatting of the output is indeed misleading.