Python make list from string [closed] - python

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
I have column with this kind of data:
I want to count how many times valu occur in a row. It is a string, so I want to convert this '63,63,63,63,63,63,63,63,63,63,63' to this ['63','63','63'...].
I there any way to do this quickly?
Thanks

if given string is s
l=s.split(',')
l is the required list

Related

How can i access the numbers in the index of this list [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 days ago.
Improve this question
So this is the list. The list contains 9 indexes and inside each indexes, there at least one position that contains more than one number. Is there a way to access each number in those posistions?
I have tried:
print(self.nums[0][1][0])
I thought that it would print out the first number of that posistion in the first index, but i recieved an error message instead.

Programing in Python [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 months ago.
Improve this question
I need help with python. How can I separate combine word into two words. At the first we don't know what kind of words could be? so we must enter a string at the input (v="") and then that word must be separate. For example we have "AMnidcrheaal" and in output will be "Andrea" and "Michal".
According to the output you gave, you want to separate odd and even indices words which can be done as follows
v="AMnidcrheaal"
even=""
odd=""
for i in range(len(v)):
if i%2==0:
even+=v[i]
else:
odd+=v[i]
print(odd)
print(even)

Discоrd Bot Event [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 10 months ago.
Improve this question
is it possible to somehow put before.rules and after.sales into two arrays, then compare the number of elements in them and subtract not their number, but the elements, so that the rest can be output later?
example
To compare the lengths of two lists, you can:
>>> print(len(after.roles)-len(before.roles))
3
In this example 3 new roles were gained

Python: replace nulls with 0 [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
What is the best way to replace all the null "NaN" values in a Python dataframe with the value 0?
Also, is it possible to do this with a for loop?
you can simply use
df.fillna(0)

Find word in a string where word is not present as a whole instead it's scattered [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I need to find a word "little" in a string but word in the string is not present as a whole.
For eg. input string="aalbeiedteetoolpue" or "lliittttllleee"
May be you can try this:
\b\w*l\w*i\w*t\w*t\w*l\w*e\w*\b
Demo

Categories