擅长:python、mysql、java
<p>如果问题是将单引号转换为双引号,而不是将其读入数据帧后的限制,则可以在将其读入数据帧之前更改<code>.csv</code>文件<em>:</p>
<p><code>$ sed -i "s/'/\"/g" file_name.csv</code></p>
<p>如果在读入数据帧后必须替换它们,请尝试<a href="https://stackoverflow.com/a/25698756/5070837">this post</a>中提到的解决方案:</p>
<p><code>df.replace({'\'': '"'}, regex=True)</code></p>