Questions tagged [case-folding]

Questions related to the case-insensitve comparison and use of strings.

Questions related to the case-insensitve comparison and use of strings. This is not as simple as merely lowercasing or uppercasing strings.

26 questions
1
vote
1 answer

Filtering two columns of a dataframe with filter

I have a dataframe of the following type: df = pd.DataFrame( { "Name": [ [ " Verbundmörtel ", " Compound Mortar ", " Malta per stucchi e per incollaggio ", ], …
1
vote
2 answers

Python looking to find an easier way to shorten my .casefold().count()

My python code is running fine but the code looks a bit tedious and messy. I was wondering if there was an easier way to write it. I have a text file and I am required to find if the letters 'aardvark' can be found inside the line. if…
Akira Wang
  • 53
  • 5
0
votes
1 answer

Not able to solve one condition in python code

I want to find in SOFTWARE column which is the new software with respect to VIN column. for example 'c5D2-14N450-CBQ' to 'c5D2-14N450-CBR'(for both software C column value should be less than or equal to 10) so, 'c5D2-14N450-CBR' is my new…
junaid
  • 1
  • 1
0
votes
0 answers

How can I convert column A in to column B with some condition in python

I have below data frame. import pandas as pd data = {'A': [ '(A|B|C,D)|(A,B|C|D)', '(A|B|C)','(A,B,C)'], 'B(Expected)': [ '(A D|B D|C D)|(A B|A C|A D)', '(A|B|C)','(A,B,C)'] } df = pd.DataFrame(data) print (df) I want to convert…
0
votes
0 answers

I am stuck in writing in OR & AND condition in python code. Actually there is a one little tricky condition

Basically there are two columns: Customer_column and Company_column. Customer_column is taking input from customer also there is a rule to insert data in (OR,AND) condition. I want check one column value into the another column. The tricky part is…
0
votes
0 answers

Case-folding the Partition Method in Python?

How can I separate a string irregardless of upper or lower case? line = 'Thing Replaces OtherThing' before, sep, after = line.partition(' replaces ') print(before) print(after) I expect the output to be "Thing" and "OtherThing". Edit: I also need…
user2820068
  • 69
  • 1
  • 5
0
votes
1 answer

Does Java regex unicode support include full case folding?

Assuming these string definitions: String lowerStream = "flüßchen"; String upperStream = "FLÜSSCHEN"; String streamPattern = ".*(ss).*"; Using this pattern: Pattern pattern = Pattern.compile(streamPattern, Pattern.CASE_INSENSITIVE |…
Hoobajoob
  • 2,748
  • 3
  • 28
  • 33
0
votes
1 answer

Easiest way to test casefolded equality for two pathlib.Paths?

In Python 3.7 or higher I want to test two pathlib.Path objects p1 and p2 for casefolded equality. Written out I want the result of str(p1).casefold() == str(p2).casefold() Is there a built-in function or operator for this? Or an easier/shorter way…
halloleo
  • 9,216
  • 13
  • 64
  • 122
0
votes
1 answer

How do I ask question about lowercase error in casefolding?

I don't understand this error... I've already turned df into lowercase before turning it into a list dataframe: 0 Masuk ke Liang Lahat, Rian D’Masiv Makin Sadar... Infotainment Untuk pertama kalinya, Rian masuk ke liang lah... 1 Alasan…
anzy859
  • 1
  • 1
0
votes
2 answers

Which case folding types does U_FOLD_CASE_DEFAULT refer to?

I'm implementing case folding in a function for JavaScript. I've code generated out of the CaseFolding.txt file the needed JavaScript code. The documentation for U_FOLD_CASE_DEFAULT says that ICU will use: default mappings defined in…
Daniel A. White
  • 187,200
  • 47
  • 362
  • 445
0
votes
2 answers

How should I remove one string from the start of another given that I know the longer string matches case-insensitively?

Suppose I have a workflow that involves examining the start of a long string (LS, say) to see whether it begins with a shorter string SS. If it does, I chop off the matching part of LS and do something with the remaining part. Otherwise, I do…
Hammerite
  • 21,755
  • 6
  • 70
  • 91
1
2