What is Nostr?
ajrlewis
npub145d…9etj
2024-09-16 13:26:37
in reply to nevent1q…fp83

ajrlewis on Nostr: ala ```python import matplotlib.pyplot as plt import numpy as np import pandas as pd ...

ala

```python
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import requests


currency = "USD"

response = requests.get(
f"https://mempool.space/api/v1/historical-price?currency={currency}";
)
data = response.json()
prices = data["prices"]

df = pd.DataFrame(prices)
df["time"] = pd.to_datetime(df["time"], unit="s")

plt.plot(df["time"], np.log2(df[currency]))
plt.ylabel(f"Historical {currency} Price [Log Base 2]")
plt.show()
```
Author Public Key
npub145dzzcseavt770mvc2xz3rvxh5w5znh3qcj8tkm3dw638m5pgwsq5q9etj