Wikipedia
"Datalore" is the 13th episode of the first season of the American science fiction television series Star Trek: The Next Generation, originally aired on January 18, 1988, in broadcast syndication. The story was created by Robert Lewin and Maurice Hurley, and turned into a script by Lewin and the creator of the show, Gene Roddenberry. It was Roddenberry's final script credit on a Star Trek series. The director was originally to be Joe Scanlan, but following delays in pre-production caused by script re-writes, it was reassigned to Rob Bowman.
Set in the 24th century, the series follows the adventures of the crew of the Starfleet starship Enterprise-D. In this episode, the Enterprise crew discover and reassemble Data's "brother", Lore (both Brent Spiner), who is in league with the entity that destroyed the colony on his home world.
The story underwent significant changes prior to filming, with it originally meant to be a romance episode for Data with a female android. It was then altered to an "evil twin" plot at the suggestion of Spiner and elements of Data's origin were introduced, first as an alien creation and then at the hands of Dr. Noonien Soong. Soong was named by Roddenberry after a friend in the Second World War. Edits to the script continued to be made during filming, and while the look of the episode was praised by cast and crew, the characterisations in the script were not. Ratings for the episode came in at 10.3 million for the first broadcast, which was lower than both the previous and subsequent episodes. Critical reception has been mixed, with criticism directed mostly at the quality of the script and Spiner praised for his dual role.