All Questions
10 questions
1
vote
3
answers
483
views
split string and integer in specific length python
Good day Everybody, I have question, is there away to split the data into fixed length ?
suppose
data=...
0
votes
2
answers
243
views
String in set of pandas dataframe but not in selected column of pandas dataframe
I have a dataframe in which one of the columns has a uniform datatype of string, and for a specific string I wanted to check if it was in that column. I found the simple comparison gave 'False', but ...
1
vote
2
answers
383
views
How to find duplicates in a string in Python 3?
My goal is to get to find the duplicate characters in a string and to replace those unique and non unique elements with other values and put those other values in another string.
I used a Counter, ...
1
vote
1
answer
63
views
How to format outputof floats so they have two places after decimal point?
this should be a very simple issue but I'm having a tougher time than expected on it. I want to have my floats be turned into strings but only to the 2nd decimal place. what I have works except with a ...
4
votes
2
answers
74
views
Return bool if a string shares all characters with another string including doubles Python-3.x
I'm sorry if a similar problem has been asked, I could not find it.
I need to check whether string_a contains all the characters from string_b including the non-unique ones.
Example 1:
... string_a ...
0
votes
2
answers
43
views
Inefficient function loads on short text, but can't load when given a super long text to analyse
I am creating a function to count the number of times each word is in a long text. When I use the below function for a short text, it runs fine without problem. However, when running it with a super ...
0
votes
0
answers
43
views
Ignore or remove duplicate tags
I have a small program that takes in html tags and then determines if the two sets of tags\attributes passed are the same or not.
This code works:
def tags_equal(str1, str2):
a = list(str1[1:-1]....
1
vote
1
answer
1k
views
How to right align the output according to the length of the largest word in a list in python 3.xx
I have:
a = ['bicycle','airplane','car','boat']
for i in a:
print("{:>??}".format(i)) # ?? because I dont know what to do here
My desired output:
bicycle
airplane
car
boat
I ...
6
votes
2
answers
941
views
Is line-joining unsupported by f-strings?
Is the following syntax not supported by f-strings in Python 3.6? If I line join my f-string, the substitution does not occur:
SUB_MSG = "This is the original message."
MAIN_MSG = f"This longer ...
0
votes
0
answers
51
views
using python 3.6 to slice substring with same char [duplicate]
I am trying to use python 3.6 to slice string into substring, without importing any module
input = "aabbbccaaa"
How can i get python to give me:
Output = ["aa", "bbb", "cc", "aaa"]
I am learning ...