list tag

251 questions


1 answers
48 views
0
Repeat list

import randomQ = int(input('drawing lots!') Please enter a quota.')numbers = list(range(1, Q + 1))R1 = random.choice(numbers)print('{} and''.format.(R1))numbers.remove(R1)R2 = random.choice(numbers)pr...


1 answers
38 views
0
After using the Python extend function, an array mark appears in the list

We created a list and wrote an extend() function that adds up the other lists in it. But the variable has the expression array().For example, if you specify k=[] and a=[1,2],[2,3],[4,5],[6,7] are adde...

2 years ago

1 answers
80 views
0
Python multilayer list data processing question.

I want to make a list of sizes (900, 156, 2) by repeating the process of averaging 2496 data with axis=1 in a three-dimensional list of sizes (900, 2496,2) in 16 window sizes and returning it as a sin...


1 answers
37 views
0
I want to know how to erase certain values on the list

As far as I know, remove() only removes the first item that looks like it, so what should I do to erase all the items from the list?The way I use it is not really Python, but it seems to be slow becau...

2 years ago

1 answers
41 views
0
To find out how many times a particular value repeats in the list

For example,list = [1,1,1,1,3,3,7,10]->1 is 4->3 is 2Is there a function that counts like this?

2 years ago

1 answers
73 views
0
How can I restore it from the zip?

I use the zip like thislist1 = ['a', 'b', 'c', 'd']list2 = [1, 2, 3, 4]result = zip(list1, list2) #[('a', 1), ('b', 2), ('c', 3), ('d', 4)]The opposite of the zip[('a', 1), ('b', 2), ('c', 3), ('d', 4...


2 answers
44 views
0
I want to save str that changes only numbers in the same character in the list

name = ['m1', 'm2', 'm3', 'm4', 'm5']I want to put a str that is combined with letters and numbers like thisIs there a function in R that functions like paste(m, 1:5, step=?

2 years ago

1 answers
39 views
0
Can't you change the contents of the list in Python function and let it be applied in the main?

def exc(lis1,lis2): lis1,lis2 = lis2,lis1 print(lis1:,lis1) print(lis2:,lis2)a = [1,2,3]b = [4,5,6]exc(a,b)print(a)print(b)When you do this,In the exc function, the a list b list comes out opposite to...

2 years ago

1 answers
130 views
0
Python List Sorting in Korean and English

When sorting the Python list, English comes first, but is there a way to make Hangul come first?names = [C, AB, N, L, DA, AA, D]sorted(names)# # Output[AA, AB, C, DA, A, N, D]# # Desired Output[a, n, ...


1 answers
126 views
0
I'd like to divide the Python list into uniform sizes

A = [1,2,3,4,5, ..., 100]TheA = [ [1,2,3,4,5,6,7,8,9,10], [11,12,13,...,20],... , [91,92,...99] ]I'm looking for a way to change it like this.I think I can use this interlator, but the cost is too hig...

2 years ago
« - 9 - »

© 2024 OneMinuteCode. All rights reserved.