-3

From strings in a dataframe, is it possible to let the user know if there is an uneven number of double quotation marks?

martineau
  • 119,623
  • 25
  • 170
  • 301
  • 2
    `if s.count('"') % 2 == 1: print("Oh no!")`? For a dataframe, do it a bunch of times? – ShadowRanger Sep 22 '20 at 11:10
  • I would like to do this check for all columns in a dataframe – Jacob Liljestrand Sep 22 '20 at 11:38
  • Does this answer your question? [How to get value counts for multiple columns at once in Pandas DataFrame?](https://stackoverflow.com/questions/32589829/how-to-get-value-counts-for-multiple-columns-at-once-in-pandas-dataframe) – Tomerikoo Sep 22 '20 at 12:19

1 Answers1

2
x = '"""'
print(x.count('"')%2==1)

output:

True
Yossi Levi
  • 1,258
  • 1
  • 4
  • 7