Help me in Basic Data Frame

Hi Everyone,

I’m new to python & want to learn and use it for Data Analysis/Data Science. Please help me to check this python syntax, i’m getting a syntax error.

import pandas as pd
pd.DataFrame({‘Q1’:[13000,100,150],‘Q2’:[14000,140,200],‘Q3’:[15000,140,250],‘Q4’[16000,180,300]},index= [‘Imp’,‘Click’,‘Eng’])


Want to create this above simple table, please help me.

Thank you

1 Like

Hi there, usually the syntax error message will give a clue about where the issue is, so including that message may help.

Here though it looks like you are missing a : after 'Q4' . You are making a DataFrame by passing in a dictionary and so it should look like {key: value, key_2: value_2} where here the keys are the column names and the values are the data for each column.

Thank you so much for your help! :innocent: