SELECT * FROM Sales where SKUDESC='samsung' AND Full_month='January'
i want output which this query gives but in python code
i am trying to groupby and i am getting name of groups .how to get values like it gives in SQL query
field=['product', 'month'] grouped=df.groupby(field).groups
Advertisement
Answer
SQL:
SELECT * FROM Sales where SKUDESC='samsung' AND Full_month='January'
Python:
new_df = df.loc[(df.SKUDESC == 'samsung') & (df.Full_month == 'January')]