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
138 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
- How to hide documents at the CouchDb?
- How can we search IBM cloudant DB to retrieve documents that match supplied field values?
- IBM Cloud Functions + Cloudant
- Authenticating with IBM Cloudant DB with API Key fails
- Cannot connect CouchDB 3.3.2 with Clauseau 2.21.5
- I'm having some trouble using IBM cloud cloudant , any help would be greatly appreciated
- Why are some of my Cloudant documents not being indexed when using Cloudant Search?
- CloudAnt: return only the last document matching an array of keys
- How do you authenticate with an API key inside an IBM Cloud Function?
- Cloudant: couch returned 500
- Invalid Chunk Length when processing Changes feed from Cloudant
- Cloudant from Cloudflare workers giving authentication error
- How do I use the number of active users of my app with my Cloudant database?
- How can I export my data from Cloudant for analytics purposes?
- Couch Client throwing Runtime exception Could not determine if _bulk_get endpoint is supported
Related Questions in WATSON-IOT
- Invalid session after login into IBM Watson IoT Platform
- IBM Watson cloud ALPN name?
- Unable to get last cached device event from watson iot while using application in python
- mqtt suscribe with IBM Watson Iot
- 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
- IBM watson internet of things platform: Connecting using mosquitto client
- Callback not found for topic using C SDK for IBM Watson
- Invalid userID() when connecting Gateway to IBM watson IoT platform
- MQTT connection connected and disconnected repeatedly
- In Node-RED/Watson IoT my Java device client keeps switching between connect and disconnect
- Watson IoT: Dashboard graphs cannot retrieve information from cloudant
- Watson IoT: "Extensions" entry is not available in left menu
- IBM Watson IoT - Unable to get response from topic with parameters using ESP8266
- Arduino failing to connect to IBM Watson IoT over wi-fi. What am I missing?
Related Questions in DSX
- How do I access a postgres table from pyspark on IBM's Data Science Experience?
- Write csv to Ibm bluemix object storage from DSX python 2.7 notebook
- DSX images generated by pixiedust display command are ugly
- Converting sensor tag data in DSX
- how to use the "display" function in a scala 2.11 with Spark 2.0 notebook in dsx
- Are notebooks accessible on the spark as a service file system?
- How to supply user functions/modules in DSX
- Scheduled job does not appear to run and no kernel files are created
- Programmatically determine if running in DSX
- How to share information across notebooks in a DSX project
- Netezza Drivers not available in Spark (Python Notebook) in DataScienceExperience
- How to install Azure module in IBM Data Science Experience
- Job schedule entry could not be created. Status code: 500
- How to install the Brunel package in a R notebook on Spark 2.0
- how to log to the kernel-pyspark-*.log from a scheduled notebook?
Related Questions in DATA-SCIENCE-EXPERIENCE
- Misalignment of column when i use str.split()
- My Jupyter notebook is not being able to take the numerical data for correlation calculation
- Need Excel Function to Manage Eyetracking Data
- Target leak in Customer Churn Model
- VIF calculation difference
- Trying to run a markdown code on my notebook and having some issues what do i do?
- I want to improve the efficiency of cosine similarity calculation to make it faster
- how can merge multiple part file into single file in databricks
- ModuleNotFoundError: No module named 'sklearn.ensemble._bagging'
- Getting error when running deepseed in dolly training with exits with return code = -9
- How to take a sum (in denominator) for calculating group by weighted average in a dataframe?
- How to calculate percentage change with zero in pandas?
- How can we assign new variables after each for loop iteration in python?
- How to check different rows values of a column within the same group and return a specific value?
- How to do k-fold cross validation and use the model to predict unseen data?
Related Questions in SPARK-CLOUDANT
- calculating skewness using spark.sql and Cloudant
- What is the solution for the error, “JBlas is not a member of package or apache”?
- com.cloudant.spark data source not found in DSX Notebook
- Converting sensor tag data in DSX
- Spark Cloudant error: 'nothing was saved because the number of records was 0!'
- Spark-cloudant package 1.6.4 loaded by %AddJar does not get used by 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 # Hahtags
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