I am a beginner in data science. So I am facing problem understanding some concepts.

What is the difference between the following codes. Why we need to convert data variable to df variable

data = {‘Fruits’: [‘BANANA AND BLUEBERRY’,’APPLE AND CHERRY’,’MANGO AND PINEAPPLE’,’WATERMELON AND PAPAYA’,’PEAR AND COCONUT’],’Price’: [2.5,3,5.5,4.5,4]}

df = pd.DataFrame(data, columns = [‘Fruits’, ‘Price’])

I am trying to understand the difference between Data Frame and Dictionary.

New contributor

Tanvir Hossain is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

1

Trả lời

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *