Q:

Join dots in scatter plot with lines throws an error

I've been following this post in order to connect points in a scatter plot with lines, the written code is:
import pandas as pd
import matplotlib.pyplot as plt
#data exploration
data = pd.read_csv("file.csv",encoding = 'utf8')
scan=[range(1,55)]
row2=data.iloc[1,1:]
plt.scatter(scan,row2)
#plt.plot(scan,row2)

If I remove the last line comment then terminal throws out:
ValueError: x and y must have same first dimension, but have shapes (1, 54) and (54,)

And prints only the scatterplot. Any help with this? I don't know how to build a complete MWE in this case (sorry for that).

A:

Try converting your range object to a list as
scan = list(range(1,55))
plt.scatter(scan, row2)
plt.plot(scan, row2)

