I am taking a course on Coursera titled "Data Analysis with Python". I am new to Python. I have some experience with C and MATLAB. That's why I haven't faced that much problem except for one thing.
At first please take a look at the following code.
import pandas as pd
#path of data
path = 'https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/IBMDeveloperSkillsNetwork-DA0101EN-SkillsNetwork/labs/Data%20files/automobileEDA.csv'
df = pd.read_csv(path)
from sklearn.linear_model import LinearRegression
lm = LinearRegression()
X = df[['highway-mpg']] #'highway-mpg' is a column in the dataframe
Y = df['price'] #'price' is a column in the dataframe
lm.fit(X,Y)
Here while defining X they have used double square brackets [[]] and in the case of Y used []. I know that square brackets are used for listing in Python and nested listing is possible. But it doesn't seem to be a nested list. Can you please differentiate between them?