0
|-------|------------|--------------|--------------|-------------|------------|------------|--------------|
| Store | Date       | Weekly_Sales | Holiday_Flag | Temperature | Fuel_Price | CPI        | Unemployment |
|-------|------------|--------------|--------------|-------------|------------|------------|--------------|
| 1     | 05-02-2010 | 1643690.90   | 0            | 42.31       | 2.572      | 211.096358 | 8.106        |
| 1     | 12-02-2010 | 1641957.44   | 1            | 38.51       | 2.548      | 211.242170 | 8.106        |
| 1     | 19-02-2010 | 1611968.17   | 0            | 39.93       | 2.514      | 211.289143 | 8.106        |
| 1     | 26-02-2010 | 1409727.59   | 0            | 46.63       | 2.561      | 211.319643 | 8.106        |
| 1     | 05-03-2010 | 1554806.68   | 0            | 46.50       | 2.625      | 211.350143 | 8.106        |
|-------|------------|--------------|--------------|-------------|------------|------------|--------------|

The Store columns range from 1 -40. How do I get the store with the maximum Weekly_Sales?

zerecees
  • 697
  • 4
  • 13

1 Answers1

0

There's so many ways to do this and you haven't given an example of how you load the data into python or what format its in so this makes answering the question difficult. I suggest you look into pandas or numpy for data analysis libraries. If this is stored in a .csv format or even a python dictionary, you could try the following:

import pandas as pd

df = pd.read_csv('file.csv', header=0)
#df = pf.from_dict(dct)

value = df.Weekly_Sales.max()
#or
index = df.Weekly_Sales.idxmax()
Bugbeeb
  • 2,021
  • 1
  • 9
  • 26