for tag

100 questions


1 answers
141 views
0
Find the mean of the numbers in the list (using for statements)

You want to average the prices in the fruit list!I even extracted the price from the listI think I can use the sum, but it's stuck.fruit = [Apple, 1020] [Orange, 880] [Grape, 3160]sum=0for i in fruit:...

2 years ago

1 answers
75 views
0
Replace string case using Python for statement

In Python, it says that to change the case of a string using the for statement, it should be the code below, but I don't know why it should be specified as new_text = str()!text = input('English case ...

2 years ago

1 answers
96 views
0
For door

How do I make this part simple as a for sentence?

2 years ago

2 answers
84 views
0
I wonder how to add elements that exist during the list tour.

data_list = [[apple, 5], [grape, 3], [apple, 2]]result_data = []check_list = []for item in data_list: if item[0] not in check_list: result_data.append(item) check_list.append(item[0]) else: for res...

2 years ago

1 answers
87 views
0
Dividing Data Frames Using Panda's Beginner Repeating Statements

Hello, Python. I'm a beginner at Panda's.Declare the entire data as F1I would like to declare it as data by dividing it 97 times by 2,000 eachThat is, F1_0 is from index number 0 to 1999, F1_1 is from...


2 answers
70 views
0
Is there a way to divide it into two using split and for statement and save it as a new data frame?

Hello. I'm practicing split and For Moon, but there's a blockage.#1.for i in range(len(df)) : df_split1[i], df_split2[i]=df.loc[i].split(sep='.', maxsplit=1)#2.for i in range(len(df)) : df.loc[i, 'c']...

2 years ago

1 answers
81 views
0
html JavaScript question. Making simple sentences simple

I want to change this code to a simple for statement, but I want to know how to change it.I want to know how to reduce it in other waysYo $(function(){ $('#main_a1').click(function(){ $('#main_conte...

2 years ago

1 answers
94 views
0
How can split be used for things that are slightly different in form (?) from each other using split, for, etc.?

Hello, I am an introvert who has been practicing split, for, and if moon recently.df = pd.DataFrame({idx5:[ ex1.x.1, ex1.x, ex2.x.2, ex2.x.3, ex1.x.2, ex2.x, ex2.x.4, ex2.x.5, ex1.x.3, ex3.x, ex2.x.6,...

2 years ago

1 answers
88 views
0
Is there a way in Python DataFrame to store a specific value position (row or column) and a specific number of values in each variable?

Hello, I'm Python beginner who is learning Python dataframe.fori in range(len(df)) if df1.loc[i, idx1]==HELLO : cnt1=cnt1+1 num=i df2.loc[10, 'idx8'] = df.at[i,'IDX8']There's a code like this, but ...


1 answers
71 views
0
I have a question about range in the for statement!

I just started coding, so I have a question for j in range(len(list2)): for w in range(len(list2[0])): if list3[w] != list2[j][w]: new_list.append(list2[j][w])J = 0, 1 w = 0, 1, 2, 3, 4, 5We know th...

2 years ago
« - 9 - »

© 2024 OneMinuteCode. All rights reserved.