I was hoping to gather insight about what I am trying to do using python: So I have this array in my function that dynamically changes everytime. What I want to do is gather the multi-dimensional array data and put them together as a single array. Here is what I have been trying so far.
Code:
def myFunction(data,topic)
data = data
topic = topic
pushed_data = []
for ctr in range(len(data)):
new_data = pushed_data.append([ctr]['topic'])
print new_data
Output:
None
So I believe "None" corresponds to the array being unsuccessfully pass to the empty array. So what I would like to have as the contents would be
Preferred Output:
['topic1','topic2','topic3']
So If it is possible to achieve this without using additional python libraries then that would be great.
topic1, etc come from?Nonecorresponds to the array being unsuccessfully pass to the empty array." This belief is incorrect..my_list = [1,2,3], thenmy_return = my_list.append(4), thenprint(my_list)andprint(my_return).