Upload 497.py
Browse files
497.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# -*- coding: utf-8 -*-
|
| 2 |
+
"""497
|
| 3 |
+
|
| 4 |
+
Automatically generated by Colab.
|
| 5 |
+
|
| 6 |
+
Original file is located at
|
| 7 |
+
https://colab.research.google.com/drive/1GsG8t6suK2oXtKkjLJgB6y0rsClY4gxd
|
| 8 |
+
"""
|
| 9 |
+
|
| 10 |
+
import pandas as pd
|
| 11 |
+
import matplotlib.pyplot as plt
|
| 12 |
+
|
| 13 |
+
df = pd.read_csv('/content/exercise_dataset.csv')
|
| 14 |
+
df.head()
|
| 15 |
+
|
| 16 |
+
weight = 300
|
| 17 |
+
|
| 18 |
+
print("Calories burned:", weight*df.iloc[0]["Calories per kg"], "kcal")
|
| 19 |
+
|
| 20 |
+
plt.scatter(df.index, df["130 lb"])
|
| 21 |
+
plt.xlabel("Index (exercise)")
|
| 22 |
+
plt.ylabel("Calories burned")
|
| 23 |
+
plt.title("Scatter plot for calories burned vs exercise index (130 lb)")
|
| 24 |
+
plt.show()
|
| 25 |
+
|
| 26 |
+
df.sort_values('Calories per kg', ascending=False)
|