Nov-04-2016, 01:37 PM
Hi there,
So I can't get readall() to work in python 3.5, I can get it to work on a raspberry pi, but with no access to said pi, I am assuming that it is running python 3.4. So I have had to use read() instead, which does work, but it is throwing up the following warning now suggesting:
But I can't work out how to do this with my current code, I am simply trying to access the column headed "timestamp" from (what I am assuming is a text file)
Here is a snippet of the code I am using, matplotlib, pandas, numpy and urllib are all imported:
Regards
iFunK
So I can't get readall() to work in python 3.5, I can get it to work on a raspberry pi, but with no access to said pi, I am assuming that it is running python 3.4. So I have had to use read() instead, which does work, but it is throwing up the following warning now suggesting:
buiys["datestamp"] = np.array(buys["timestamp"]).astype("datetime64[s]")be changed in format to:
.loc[row_indexer,col_indexer] = valueinstead.
But I can't work out how to do this with my current code, I am simply trying to access the column headed "timestamp" from (what I am assuming is a text file)
Here is a snippet of the code I am using, matplotlib, pandas, numpy and urllib are all imported:
from matplotlib import pyplot as plt import matplotlib.dates as mdates import matplotlib.ticker as mticker import tkinter as tk from tkinter import ttk import urllib import json import pandas as pd import numpy as np data_link = 'https://btc-e.com/api/3/trades/btc_usd?limit=2000' data = urllib.request.urlopen(data_link) data = data.read().decode("utf-8") data = json.loads(data) data = data["btc_usd"] data = pd.DataFrame(data) buys = data[(data['type']=="bid")] print (buys) buys["datestamp"] = np.array(buys["timestamp"]).astype("datetime64[s]") buyData = (buys["datestamp"]).tolist()Typing this straight into python3 window reproduces the error. How should I be accessing the data from this file (which I am assuming is a dictionary of dictionaries)
Regards
iFunK