Reputation: 27
import pandas as pd
wine_dict = {
'red_wine': [3, 6, 5],
'white_wine':[5, 0, 10]
}
sales = pd.DataFrame(wine_dict, index=["adam", "bob", "charles"])
print(sales)
Please help me to run the code in my IDE.
Upvotes: 1
Views: 3075
Reputation: 450
The code you have pasted contains indented statements. Indents have a meaning in Python.
Leading whitespace (spaces and tabs) at the beginning of a logical line is used to compute the indentation level of the line, which in turn is used to determine the grouping of statements.
Your code works fine after removing all the indents.
Edit:
import pandas as pd
wine_dict = {
'red_wine': [3, 6, 5],
'white_wine':[5, 0, 10]
}
sales = pd.DataFrame(wine_dict, index=["adam", "bob", "Charles"])
print(sales)
Upvotes: 2
Reputation: 49
you are running code in idle itself. go to new file paste the code and then run it.
I hope it works.
Upvotes: 1