Question

Assuming you have a TextBlob named blob containing 'Today is a beautiful day. Tomorrow looks like...

Assuming you have a TextBlob named blob containing 'Today is a beautiful day. Tomorrow looks like bad weather.', what property should replace the ? in the following snippet to get the output shown below?

In [8]: blob.?
Out[8]: WordList(['Today', 'is', 'a', 'beautiful', 'day', 'Tomorrow', 'looks', 'like', 'bad', 'weather'])Immersive Reader
(3 Points)
word
wordOflist
words
listwords

Which of the following statements about NumPy’s linspace function is false?Immersive Reader
(3 Points)
You can produce evenly spaced floating-point ranges with linspace.
The function’s first two arguments specify the starting and ending values in the range, and the ending value is included in the array
The optional keyword argument num specifies the number of evenly spaced values to produce—this argument’s default value is 50.
All of the above statements are true.

Homework Answers

Answer #1

Assuming you have a TextBlob named blob containing 'Today is a beautiful day. Tomorrow looks like bad weather.', what property should replace the ? in the following snippet to get the output shown below?

Ans) C. words

The ? will replace with words.

It will return a list of word tokens.

It has the same function as that of split() as both returns list of word tokens.

In blob we have the string so it will return list of tokens when blob.words is executed.

----------------------------------------------------------------------------------------------------------------------------------------------------------

Which of the following statements about NumPy’s linspace function is false?

Ans) D. All of the above statements are true.

If endpoint argument is True then ending is included and by default it is True but if the argument endpoint is False then the ending pooint will be excluded.

np.linspace(2,5)

here,

2->starting point

5->ending point

If the above code runs we get an array of length 50.

array([2.        , 2.06122449, 2.12244898, 2.18367347, 2.24489796,
       2.30612245, 2.36734694, 2.42857143, 2.48979592, 2.55102041,
       2.6122449 , 2.67346939, 2.73469388, 2.79591837, 2.85714286,
       2.91836735, 2.97959184, 3.04081633, 3.10204082, 3.16326531,
       3.2244898 , 3.28571429, 3.34693878, 3.40816327, 3.46938776,
       3.53061224, 3.59183673, 3.65306122, 3.71428571, 3.7755102 ,
       3.83673469, 3.89795918, 3.95918367, 4.02040816, 4.08163265,
       4.14285714, 4.20408163, 4.26530612, 4.32653061, 4.3877551 ,
       4.44897959, 4.51020408, 4.57142857, 4.63265306, 4.69387755,
       4.75510204, 4.81632653, 4.87755102, 4.93877551, 5.        ])

The type of arguments linspace have are as follows:

np.linspace(
    start,  # starting point
    stop,   # ending point
    num=50, # total length of array
    endpoint=True,  # To include the endpoint or not
    retstep=False,  # Returns the step size and the array
    dtype=None,    # the type of output array    
)

---------------------------------------------------------------------------------------------------------------------------------------------------------

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions