Generate an array of integers from 0 to 99 and split it into two smaller arrays. Each smaller array will contain half of the original.

Import numpy

originalArray = numpy.range(100)

split1 = originalArray[:len(originalArray)/2] #The use of a :X as an index into an array means that you want all values from the start to the Xth value

split2 = originalArray[len(originalArray)/2:] #The use of a X: as an index into an array means that you want all values from the Xth value to the end

SH

Related Python Mentoring answers

All answers ▸

Write a python function that takes a string as parameter and returns the character in the string with the most occurrences, along with the number of times this character occurs


With the help of Pandas and Numpy library create a DataFrame with the columns "Name", "Surname", "Age" and "Gender", create as many rows as you want. Print out the result.


Print "Hello World!" ten times without typing (or pasting) the print function more than once


What is Object-Oriented Programming?