How to use NumPy In Python
Numpy is used to process the arrays, we can get the values by using key or index
Python3
# import numpy module import numpy as np # create numpy data data = np.array([( 10 , 20 ), ( 50 , 60 )], dtype = [( 'value1' , int ), ( 'value2' , int )]) # display by using index print (data[ 0 ]) # display by using key print (data[ 'value1' ]) |
Output:
(10, 20) [10 50]
Time Complexity: O(n)
Auxiliary Space: O(n)
Python – Convert list of dictionaries to dictionary of lists
In this article, we will discuss how to convert a list of dictionaries to a dictionary of lists.
Contact Us