15,895,084 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Member 14891535 (Top 29 by date)
Member 14891535
19-Jul-20 9:05am
View
Thanks. Do you have any idea how to check my connection is working? I presume is not related to MySQL
Member 14891535
19-Jul-20 8:44am
View
Can I know are you using ipython notebook to run your code?
Is it the exact code as I paste above?
Member 14891535
19-Jul-20 8:03am
View
Thanks. I had a look at the documentation provided, I presume is not related to MySQL
import sqlite3
conn = sqlite3.connect('example.db')
c = conn.cursor()
# Create table
c.execute('''CREATE TABLE stocks
(date text, trans text, symbol text, qty real, price real)''')
# Insert a row of data
c.execute("INSERT INTO stocks VALUES ('2006-01-05','BUY','RHAT',100,35.14)")
# Save (commit) the changes
conn.commit()
# We can also close the connection if we are done with it.
# Just be sure any changes have been committed or they will be lost.
conn.close()
It have error:
---------------------------------------------------------------------------
ProgrammingError Traceback (most recent call last)
<ipython-input-12-350b4286edc5> in <module>()
----> 1 c = conn.cursor()
2
3 # Create table
4 c.execute('''CREATE TABLE stocks
5 (date text, trans text, symbol text, qty real, price real)''')
ProgrammingError: Cannot operate on a closed database.
Member 14891535
19-Jul-20 7:25am
View
Updated my questions, such a nice person you are. But I do not hope you will reply and help.
Member 14891535
19-Jul-20 4:43am
View
This is already solve, I posted long time ago. Thanks.
Member 14891535
19-Jul-20 4:34am
View
I managed to used numpy library to calculate the standard deviation (definition is not an issue for me), the problem is I want to get the x, y, z of each element together.
stddev = np.std(coordinates, axis=1)
print "standard deviation:", stddev
Member 14891535
18-Jul-20 14:47pm
View
please be polite. every human is different. you are intelligent, does not mean me
at the end of the days, everyone will die
Member 14891535
18-Jul-20 9:26am
View
Not your problem. Thanks for the guideline. I am glad that I am able to follow it now.
Member 14891535
18-Jul-20 9:05am
View
I found the mistake. is restjson=json.loads(data) and not restjson=json.load
(data)
Member 14891535
18-Jul-20 9:02am
View
The string name I put is either data, URL, but still cannot get through AttributeError Traceback (most recent call last)
<ipython-input-36-ec02c085a96e> in <module>()
9
10 # decode the response from the REST service
---> 11 restjson=json.load(response)
Member 14891535
18-Jul-20 8:41am
View
Thanks. What is the meaning of httpresponse? I suppose to be:
url = "https://ws1.chic.ulster.ac.uk/SensorCentral/REST/SensorDataRangeNanos/flgSh9oHnutzvZVOnnixFNjXIda2zula_101_101?startTs=1594297110372000000&endTs=1594297110372000000"
response = requests.get(url)
data = response.text
parsed = json.loads(data)
restjson=json.load(data)
Member 14891535
18-Jul-20 8:37am
View
Thanks. That is fine, I am a beginner only and I will skip this steps and move to setting up MySQL which is second step. Thanks for your advices.
Member 14891535
18-Jul-20 8:12am
View
Do you mean (There are double quotes surrounding the array after blobJson,) in the original dataset in the URL? if yes, the URL is provided, I cannot change it.
Member 14891535
18-Jul-20 7:58am
View
I just found this. https://docs.oracle.com/javacomponents/advanced-management-console-2/install-guide/mysql-database-installation-and-configuration-advanced-management-console.htm#JSAMI-GUID-00D8401C-C5EF-4F7C-B211-8B268BA0DB91
Before that, can I know can I setup MySQL database in my personal laptop?
Member 14891535
18-Jul-20 6:35am
View
Thanks. I have a follow up question regarding mySQL
https://www.codeproject.com/Questions/5274107/Running-SQL-cannot-get-into
Member 14891535
18-Jul-20 6:22am
View
I understand this. This is not related to coursework assignment. Is a competition.
I had break this to several questions where I got stuck.
https://www.codeproject.com/Questions/5274079/How-to-store-a-retrieved-data-in-a-database-of-my
I am not asking full solutions.
Member 14891535
18-Jul-20 5:31am
View
Okay, thanks. i think I move on to next steps. I do understand and read the link you provided. Thanks.
Member 14891535
18-Jul-20 5:09am
View
yes, I understand, In fact, I couldnt solve it even I had tried.
parsed = json.loads(data)
print(json.dumps(parsed, indent=1))
Member 14891535
18-Jul-20 5:06am
View
Thanks. Is it possible to retrieve only 2 data from the blobJson?
I had tried this:
import requests
import json
url = "https://ws1.chic.ulster.ac.uk/SensorCentral/REST/SensorDataRangeNanos/flgSh9oHnutzvZVOnnixFNjXIda2zula_101_101?startTs=1594297110372000000&endTs=1594297110372000000"
response = requests.get(url)
data = response.text
parsed = json.loads(data)
print(json.dumps(parsed, indent=1))
Member 14891535
18-Jul-20 4:55am
View
I will edit my questions.
Yes, i am fully understand this. I am panic.
I had tried my first steps:
import requests
import json
url = "https://ws1.chic.ulster.ac.uk/SensorCentral/REST/SensorDataRangeNanos/flgSh9oHnutzvZVOnnixFNjXIda2zula_101_101?startTs=1594297110372000000&endTs=1594297110372000000"
response = requests.get(url)
data = response.text
parsed = json.loads(data)
print(json.dumps)
%print(json.dumps(parsed, indent=1))
(Above code is I written myself after searching for almost 3 days)
I have no idea where I can search and do second steps.
Member 14891535
18-Jul-20 4:55am
View
Yes, i am fully understand this. I am panic.
I had tried my first steps:
import requests
import json
url = "https://ws1.chic.ulster.ac.uk/SensorCentral/REST/SensorDataRangeNanos/flgSh9oHnutzvZVOnnixFNjXIda2zula_101_101?startTs=1594297110372000000&endTs=1594297110372000000"
response = requests.get(url)
data = response.text
parsed = json.loads(data)
print(json.dumps)
%print(json.dumps(parsed, indent=1))
(Above code is I written myself after searching for almost 3 days)
I have no idea where I can search and do second steps.
Member 14891535
17-Jul-20 21:15pm
View
Yes, how should I start and continue?
Member 14891535
17-Jul-20 13:04pm
View
yes, i did used parsed = json.loads(data)
Member 14891535
17-Jul-20 12:41pm
View
Thanks, I had improved my question. Hope is better
Member 14891535
17-Jul-20 12:22pm
View
Oh, okay, maybe the words that I used incorrect. But I still unable to figure out
Member 14891535
17-Jul-20 10:35am
View
print(json.dumps(parsed, indent=1))
Member 14891535
17-Jul-20 10:35am
View
Thanks. I did had a tried, but cannot get which library should I used.
Member 14891535
17-Jul-20 9:40am
View
Any idea can advice? which I struggle in
Member 14891535
17-Jul-20 9:32am
View
But can I set which one to printout?
Show More