Robotics and Your Job

Now that word has gotten around that I’ve been working with both data science projects (Python for Data Science for Dummies) and machine learning projects (Machine Learning for Dummies), people have begun asking me hard questions, such as whether a Terminator style robot is possible (it isn’t, Ex Machina and The Terminator notwithstanding) or whether they’ll be without work sometime soon (the topic of this post). (As an aside, deus ex machina is a literary plot device that has been around for a long time before the movie came out.)

Whether your job is secure depends on the kind of job you have, whether robotics will actually save money, what you believe as a person, and how your boss interprets all the hype currently out there. For example, if your claim to fame is flipping burgers, then you’d better be ready to get another job soon. McDonald’s is currently opening a store that uses robots in Phoenix and plans to have 25,000 more moved to robotics by the end of 2016. Some jobs are simply going to go away, no doubt about it.

However, robots aren’t always the answer to the question. Many experts see three scenarios: humans working for robots (as in a doctor collaborating with a robot to perform surgery more accurately and with greater efficiency), humans servicing robots (those McDonald’s jobs may be going away, but someone will have to maintain the robots), and robots working for humans (such as that Roomba that’s currently keeping your house clean). The point is that robots will actually create new jobs, but that means humans will need new skills. Instead of boring jobs that pay little, someone with the proper training can have an interesting job that pays moderately well.

An interesting backlash against automation has occurred in several areas. So, what you believe as a person does matter when it comes to the question of jobs. The story that tells the tale most succinctly appears in ComputerWorld, Taxpayer demand for human help soars, despite IRS automation. Sometimes people want a human to help them. This backlash could actually thwart strategies like the one McDonald’s plans to implement. If McDonald’s finds that the robots cost too much to run or that people are going to the competition to obtain food from other humans, it might need to reevaluate what appears to be a winning strategy. However, the backlash would need to involve a significant part of the population of people who buy food at McDonald’s to induce the company to make the change.

There is also the boss’ perspective to consider. A boss is only a boss as long as there is someone or something to manage. Even though your boss will begrudgingly give up your job to automation, you can be sure that giving up a job personally isn’t on the list of things to do. Some members of the press have resorted to viewing the future as a time when robots do everything and humans don’t work, but really, this viewpoint is a fantasy. However, it’s not a fantasy that companies such as Hitachi are experimenting with robot managers. Some employees actually prefer the consistent interaction of a robot boss. It’s unlikely that managers will take this invasion of their domain sitting down and do something to make using robots untenable.

It really is too soon to tell where robots will go for one simple reason. The algorithms used to make robots functional are still works in progress. In addition, society must decide the place that robots will take. The interaction between business and the people that businesses serve will play a distinct role in how things play out. However, all this said, your job will likely be different in the future due to the influences of robots. For the most part, I feel that life will be better for everyone after the adjustment, but that the adjustment will be quite hard. Let me know your thoughts on robots at John@JohnMuellerBooks.com.

 

Python for Data Science for Dummies Errata on Page 221

The downloadable source for Python for Data Science for Dummies contains a problem that doesn’t actually appear in the book. If you look at page 221, the code block in the middle of the page contains a line saying import numpy as np. This line is essential because the code won’t run without it. The downloadable source for Chapter 12 is missing this line so the example doesn’t run. This P4DS4D; 12; Stretching Pythons Capabilities link provides you with a .ZIP file that contains the replacement source code. Simple remove the P4DS4D; 12; Stretching Pythons Capabilities.ipynb file from the archive and use it in place of your existing file.

Luca and I always want you to have a great experience with our book, so keep those emails coming. Please let me know if you have any questions about source code file update at John@JohnMuellerBooks.com. I’m sorry about any errors that appear in the downloadable source and appreciate the readers who have pointed them out.

 

Python for Data Science for Dummies Errata on Page 145

Python for Data Science for Dummies contains two errors on page 145. The first error appears in the second paragraph on that page. You can safely disregard the sentence that reads, “The use_idf controls the use of inverse-document-frequency reweighting, which is turned off in this case.” The code doesn’t contain a reference to the use_idf parameter. However, you can read about it on the Scikit-Learn site. This parameter defaults to being turned on, which is how it’s used for the example.

The second error is also in the second paragraph. The discussion references the tf_transformer.transform() method call. The actual method call is tfidf.transform(), which does appear in the sample code. The discussion about how the method works is correct, just the name of the object is wrong.

Please let me know if you have any questions about either of these changes at John@JohnMuellerBooks.com. I’m sorry about any errors that appear in the book and appreciate the readers who have pointed them out.

 

Using Jupyter with Anaconda (Updated)

A few readers have recently written to me regarding the use of Jupyter with the downloadable source for Python for Data Science for Dummies. The version of Anaconda recommended for the book, 2.1.0, doesn’t rely on Jupyter, which is why the book doesn’t mention Jupyter. The book relies on IPython Notebook, which is what you should use to obtain the best reading experience. You can obtain the proper version from the Continuum archive. However, if you choose to download the current version of Anaconda, then using Jupyter becomes a possibility; although, many of the procedures found in the book will require tweaking and the screenshots won’t match precisely.

In order to use Jupyter, you must still import the downloaded files into your repository. The source code comes in an archive file that you extract to a location on your hard drive. The archive contains a list of .ipynb (IPython Notebook) files containing the source code for this book (see the Introduction for details on downloading the source code). The following steps tell how to import these files into your repository:

  1. Click Upload at the top of the page. What you see depends on your browser. In most cases, you see some type of File Upload dialog box that provides access to the files on your hard drive.
  2. Navigate to the directory containing the files you want to import into Notebook.
  3. Highlight one or more files to import and click the Open (or other, similar) button to begin the upload process. You see the file added to an upload list, as shown here. The file isn’t part of the repository yet—you’ve simply selected it for upload.

    Click Upload when you want to upload files to the repository.
    Upload Source Files to the Repository
  4. Click Upload. Notebook places the file in the repository so that you can begin using it.

It’s important to both Luca and me that you have the best possible learning experience with our book. This means using the right version of Anaconda for most people. Using the latest version shouldn’t cause problems, but we’d like to know if it does. Please feel free contact me at John@JohnMuellerBooks.com with your book-specific questions.


Update

It has come to our attention since this post first published that using the latest version of Anaconda with Python for Data Science for Dummies is problematic. Some of the examples won’t work without rewriting because the Pandas Categorical class has changed. This is the only change we’ve confirmed so far, but there are no doubt other changes. In order to get the proper results from the examples in the book, you must use the correct version of Anaconda, version 2.1.0.

Please do keep those questions coming. It’s because a reader took time to write that Luca and I became aware of this problem. We truly do want you to have a great learning experience, so these questions are important!

 

Technology and Child Safety

I recently read an article on ComputerWorld, Children mine cobalt used in smartphones, other electronics, that had me thinking yet again about how people in rich countries tend to ignore the needs of those in poor countries. The picture at the beginning of the article says it all, but the details will have you wondering whether a smartphone really is worth some child’s life. That’s right, any smartphone you buy may be killing someone and in a truly horrid manner. Children as young as 7 years old are mining the cobalt needed for the batteries (and other components) in the smartphones that people seem to feel are so necessary for life (they aren’t you know).

The problem doesn’t stop when someone gets the smartphone. Other children end up dismantling the devices sent for recycling. That’s right, a rich country’s efforts to keep electronics out of their landfills is also killing children because countries like India put these children to work taking them apart in unsafe conditions. Recycled wastes go from rich countries to poor countries because the poor countries need the money for necessities, like food. Often, these children are incapable of working by the time they reach 35 or 40 due to health issues induced by their forced labor. In short, the quality of their lives is made horribly low so that it’s possible for people in rich countries to enjoy something that truly isn’t necessary for life.

I’ve written other blog posts about the issues of technology pollution. One of the most recent is More People Noticing that Green Technology Really Isn’t. However, the emphasis of these previous articles has been on the pollution itself. Taking personal responsibility for the pollution you create is important, but we really need to do more. Robotic (autonomous) mining is one way to keep children out of the mines and projects such as The Utah Robotic Mining Project show that it’s entirely possible to use robots in place of people today. The weird thing is that autonomous mining would save up to 80% of the mining costs of today, so you have to wonder why manufacturers aren’t rushing to employ this solution. In addition, off world mining would keep the pollution in space, rather than on planet earth. Of course, off world mining also requires a heavy investment in robots, but it promises to provide a huge financial payback in addition to keeping earth a bit cleaner (some companies are already investing in off world mining, but we need more). The point is that there are alternatives that we’re not using. Robotics presents an opportunity to make things right with technology and I’m excited to be part of that answer in writing books such as Python for Data Science for Dummies and Machine Learning for Dummies (see the posts for this book).

Unfortunately, companies like Apple, Samsung, and many others simply thumb their noses at laws that are in place to protect the children in these countries because they know you’ll buy their products. Yes, they make official statements, but read their statements in that first article and you’ll quickly figure out that they’re excuses and poorly made excuses at that. They don’t have to care because no one is holding them to account. People in rich countries don’t care because their own backyards aren’t sullied and their own children remain safe. So, the next time you think about buying electronics, consider the real price for that product. Let me know what you think about polluting other countries to keep your country clean at John@JohnMuellerBooks.com.

 

Python for Data Science for Dummies Errata on Page 124

Python for Data Science for Dummies contains an error in the example that appears on the top half of page 124. In the first of the two grey boxes, the code computes the results of four print statements. The bottom-most print statement, print x[1:2, 1:2], is supposed to compute a result based on rows 1 and 2 of columns 1 and 2, and the bottom grey box seems to confirm that interpretation by the showing the result as [[[14 15 16] [17 18 19]] [[24 25 26] [27 28 29]]]. However, the answer provided for this example in the downloadable source code is [[[14 15 16]]], which doesn’t agree with that in the text.

The good news is that the downloadable source contains the correct code. The error appears only in the book. The last print statement in the book is wrong. Here is the correct code (with output) for this example:

x = np.array([[[1, 2, 3], [4, 5, 6], [7, 8, 9],],
 [[11,12,13], [14,15,16], [17,18,19],],
 [[21,22,23], [24,25,26], [27,28,29]]])

print x[1,1]
print x[:,1,1]
print x[1,:,1]
print
print x[1:3, 1:3]
[14 15 16]
[ 5 15 25]
[12 15 18]

[[[14 15 16]
 [17 18 19]]

[[24 25 26]
 [27 28 29]]]

Please let me know if you have any questions about this example at John@JohnMuellerBooks.com. I’m sorry about the error that appears in the book and appreciate the readers who have pointed it out.

 

Missing XMLData2.xml File

A number of readers have written to report that XMLData2.xml is missing from the downloadable source for Python for Data Science for Dummies. You encounter this file in Chapter 6, on page 108. The publisher has already added the file to the downloadable source, but you might be missing the file from your copy. If so, you can download it by clicking XMLData2.zip. I’m truly sorry about any problems that the missing file might have caused. Please be sure to let me know about your book specific question at John@JohnMuellerBooks.com.

 

Warnings in Python and Anaconda

It seems as if Python developers are having more than a few problems at the moment from a number of sources. I recently wrote about the potential issues for readers of Beginning Programming with Python For Dummies and Python for Data Science for Dummies from Windows 10 (Python and Windows 10). However, some readers have come back afterward to say they’re still seeing warnings. It wasn’t until one of the beta readers for Machine Learning for Dummies also saw some of these warnings that it became apparent that some other problem is at work. A recent upgrade to NumPy 1.10.1 has created these warnings. You can see some message threads about the issue at:

The important thing to remember is that you’ll see warnings, not errors (unless there is a problem Luca, my coauthor for Python for Data Science for Dummies, and I haven’t seen yet). For now, updating all of the Anaconda components is the only way to actually get rid of the warnings, which can prove to be quite a pain. However, the warnings are just that, warnings. The code in the books will still run just fine. The best way to avoid a lot of work and potentially creating yet more problems is to ignore the warnings for now. In order to ignore the warnings, type the following two lines of code:

import warnings
warnings.simplefilter("ignore")

Obviously, the situation is inconvenient for everyone, but the various libraries will get in sync sometime soon and then the warnings will disappear until the next set of updates. Please let me know if you continue to see problems after making this fix at John@JohnMuellerBooks.com.

 

A Future Including Virtual Reality

Seeing is believing—at least, that’s how it’s supposed to be. However, seeing may not mean believing anything in the future. During the building of the PC for Build Your Own PC on a Budget, I investigated various new technologies, including virtual reality, where what you see may not exist at all. Of course, gamers are eagerly anticipating the Oculus Rift, which promises to transform gaming with a monitor into an experience where you really feel as if you’re there. This kind of technology isn’t quite available yet, but will be soon. Even when the hardware is ready and the drivers work as promised, truly immersive games will take time to create. Look for this experience to evolve over time to the point where the Holodeck featured in Star Trek actually does become a reality.

To attract attention and become viable, however, technology must answer specific needs today. It was with great interest that I read Marines test augmented reality battlefield. Unlike the Oculus Rift, this technology actually does exist today and it demonstrates some of the early uses of virtual reality that you can expect to see. In this case, the background is real—it’s an actual golf course. The virtual reality system adds the hardware of war to the scene, including tanks, mortars, and features, such as smoke. What the marine sees is a realistic battlefield that doesn’t exist anywhere but the viewer’s glasses. This is the sort of practical use of virtual reality that will continue to drive development until we get a holodeck sometime in the future.

Virtual reality for gamers and the armed services is nice, but it’s also becoming a reality for everyone else. Samsung and Facebook are introducing a virtual reality solution for movie goers. That’s right, you’ll be able to strap some glasses to your head and get transported to a comfy living room with a big screen TV where you can watch the latest movies offered by Netflix. The Gear VR device promises to change the way that people see movies forever. This particular device actually works with your smartphone, so you need a compatible smartphone to use it. In addition to movies, Gear VR also promises to let you play virtual reality game and become involved in other immersive environments. All you really need is the right app.

An immersive experience, where you eventually won’t be able to tell real from created, is what virtual reality promises. Using virtual reality, you could travel to other parts of the world, explore the ocean depths, or even saunter through the solar system as if you’re really there, but still be in your own home. Virtual reality will eventually transform all sorts of environments, including the classroom. Imagine children going to school, interacting with other students, learning from the best instructors, and never leaving their home. A student could get a top notch education for a fraction of the cost that students pay today.

Coupling virtual reality with other technologies, such as robotics, could also allow people to perform a great many unsafe tasks in perfect safety. A human could guide a robot through a virtual reality connection to perform real world tasks that would be unsafe for a human to perform alone. Think about the use of the technology in fighting fires or responding to terrible events that currently put first responders at risk. Virtual reality will eventually change the way we view the world around us and I hope that the experience is as positive as vendors are promising today. Let me know your thoughts about virtual reality at John@JohnMuellerBooks.com.

 

Tip Error in Python for Data Science for Dummies

There is a small error on page 318 of Python for Data Science for Dummies. You can find it near the middle of the page in the Tip text. The current text on the second line of that paragraph says, “k as a number near the squared number of available observations.” However, the text should really read, “k as a number near the squared root number of available observations.” The word root is missing, which obviously changes the mathematical meaning of the text. Please accept our apologies for the typo. Let me know if you find any other errors of a technical nature in the book at John@JohnMuellerBooks.com and I’ll be sure to provide a blog post about it here. Thank you for your support!