I'm working on converting the existing recipe for Data Science Experience (DSX) to use data from a connected Sensor Tag device. However the mobile applications for that device send the data as strings rather than numerics - this is causing the DSX recipe that calculates a Z score to choke. The data is coming from a cloudant db used as a histtorian for Watson IoT Platform so I cant simply reformat it there. Is there a simple way to convert the data inside a DSX notebook ?
Converting sensor tag data in DSX
137 Views Asked by Skilganon At
2
There are 2 best solutions below
2
Romeo Kienzler
On
Just access the row object and convert it:
cloudantdata.rdd.map(lambda row : float(row.temperature)).take(10)
EDIT 30.1.17:
To directly address your question:
df = cloudantdata.selectExpr("timestamp as timestamp", "data.d.objectTemp as temperature").map(lambda row : (row.timestamp,float(row.temperature)))
That way you get a tuple RDD which IMHO anyway is more usable as a RowRDD
Related Questions in CLOUDANT
- Do 'reduce' with results from Cloudant search?
- node.js processing a form with Node.js Cloudant DB Web Starter
- How to write query to my Cloudant database?
- How can I tell if my SDP process is still running the 'initial' load?
- how to 'flatten' the table in dashDB created by the schema discovery process (SDP)?
- How can I debug problems with warehouse creation?
- How to get a "fieldcount" (like wordcount) on CouchDB/Cloudant?
- SQLCODE=-911 : "warehouser_error_message": "File <<filename>>.csv.zip could not be loaded due to an exception in dashDB
- Installing package R4CouchDB version 0.5.1 on R 3.1
- DashDB sync with Cloudant doesn't work
- dashdb out of memory on Cloudant sync
- JSON data not uploading to database
- Is it possible to dynamically add views in cloudant (couchdb) through node.js using nano
- Expire documents in Cloudant
- Cloudant Database Map Reduce
Related Questions in WATSON-IOT
- connection lost when waiting for connack response using mqtt websockets for ibm bluemix watson iot
- REST POST not responding in Xamarin.Android App. It is responding with Postman but not app.
- I not able to connect to ibm bluemix
- How publish data from multiple devices using a single connection to a broker
- How to plot live location with device map widget using ibm bluemix iot service?
- Using message topic in IBM Watson internet of things platform rules
- Connecting ESP8266 to IBM Watson with Micropython
- Node-RED or Webhook action not working after rule on Watson IoT Platform
- My device not connecting to IBM Watson using contiki
- IBM watson internet of things platform: Connecting using mosquitto client
- Callback not found for topic using C SDK for IBM Watson
- IBM Watson IoT Platform - How to get last event / state of a device
- Looking for a working example of a non-secure bridge between a local Mosquitto instance and the Watson IoT platform
- Device can be managed but actions not available anymore in the dashboard
- How to handle SSL Certificate Expiry for IOT devices connected to the Watson IOT Platform
Related Questions in DSX
- DSX notification if scheduled notebook does not run?
- how to log to the kernel-pyspark-*.log from a scheduled notebook?
- How to troubleshoot a DSX scheduled notebook?
- How to install the Brunel package in a R notebook on Spark 2.0
- Job schedule entry could not be created. Status code: 500
- How to install Azure module in IBM Data Science Experience
- How to share information across notebooks in a DSX project
- Netezza Drivers not available in Spark (Python Notebook) in DataScienceExperience
- Programmatically determine if running in DSX
- How to supply user functions/modules in DSX
- Scheduled job does not appear to run and no kernel files are created
- Are notebooks accessible on the spark as a service file system?
- how to use the "display" function in a scala 2.11 with Spark 2.0 notebook in dsx
- Converting sensor tag data in DSX
- DSX images generated by pixiedust display command are ugly
Related Questions in DATA-SCIENCE-EXPERIENCE
- How can I enable SQL Magics in Jupyter Notebooks on IBM Data Science Experience?
- Spark-cloudant package 1.6.4 loaded by %AddJar does not get used by notebook
- IBM Watson Studio Notebooks on Safari, sometimes shows `Connection Failed`or `Kernel Dead`
- DSX notification if scheduled notebook does not run?
- how to log to the kernel-pyspark-*.log from a scheduled notebook?
- How to troubleshoot a DSX scheduled notebook?
- How to prevent 'pip install ...' running every time I run the whole notebook?
- Connecting RStudio to DashDB in the IBM Watson Studio
- Python 2 with Spark 2.0
- IBM Data Science Experience (DSX): Using ibmdbR on RStudio
- IPython Notebook: Why do not appearing the widgets after installing correctly ipywidgets in DSX?
- java.lang.AbstractMethodError: com/ibm/stocator/fs/common/IStoreClient.setStocatorPath(Lcom/ibm/stocator/fs/common/StocatorPath;)V
- IBM Data Science Experience (DSX): How to connect with Client's ORACLE Database
- No FileSystem for scheme: cos
- IBM Data Science Experience (DSX): Decision Optimization in DSX
Related Questions in SPARK-CLOUDANT
- Spark-cloudant package 1.6.4 loaded by %AddJar does not get used by notebook
- Spark Cloudant error: 'nothing was saved because the number of records was 0!'
- What is the solution for the error, “JBlas is not a member of package or apache”?
- calculating skewness using spark.sql and Cloudant
- Converting sensor tag data in DSX
- com.cloudant.spark data source not found in DSX Notebook
- Why does sbt assembly in Spark project fail with "Please add any Spark dependencies by supplying the sparkVersion and sparkComponents"?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I'm not familiar with DSX but you can use node red to parse the information from devices then store it in cloudant db in numeric format