Quotes help make search much faster. Example: "Practice Makes Perfect"

Saturday, August 31, 2019

Codecademy Learn Statistics With Python Histograms Exercise 7/9


# Sample Solution
# Import packages
import codecademylib
import numpy as np
import pandas as pd

# import pyplot as plt
from matplotlib import pyplot as plt

# Read in transactions data
transactions = pd.read_csv("transactions.csv")

# Save transaction times to a separate numpy array
times = transactions["Transaction Time"].values

# Use plt.hist() below
plt.hist(times, range = (0, 24), bins = 4, edgecolor = 'black')
plt.title("Transaction Time Histogram")
plt.xlabel("Time Ranges")
plt.ylabel("Count")
plt.show()

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts