하나는 "하나, 둘, 셋"등의 쉼표로 구분 된 텍스트가 포함되어 있습니다.쉼표로 구분 된 텍스트를 바꾸는 방법?</p> <pre><code>df = Col1 Col2 One, two, three Abc Two Def </code></pre> <p>내가 <code>One_two_three</code>에 의해 <code>One, two, three</code>를 교체하려면 : 내 dataframe의 열
이 코드 적용하는 경우 :
df['Col1'].replace("One, two, three", "One_two_three",inplace=True)
를 ... 그것은 아무것도 변경되지 않습니다. 왜?
'print (df ['Col1 '] .iloc [0])'output? st.replace (',', '_') ' – EdChum
@EdChum :'One, two, three'을 출력합니다. – Dinosaurius
@EdChum : 제안 된 솔루션을 테스트했습니다. 동일한 결과 인 'One, Two, Three'를 출력합니다. 글쎄요, 더 구체적으로 말하자면 저는 실제로 하나, 둘, 셋을 가지고 있지만 그것이 변화한다고 생각하지 않습니다. – Dinosaurius