在用pandas.DataFrame.to_csv()方法时,如果使用默认编码或者指定编码为'utf-8'时中文会乱码。
import pandas as pd
df = pd.DataFrame()
df.to_csv(encoding='utf-8')
问题的根源在于文件开头没有BOM。
/* | |
* Licensed to the Apache Software Foundation (ASF) under one | |
* or more contributor license agreements. See the NOTICE file | |
* distributed with this work for additional information | |
* regarding copyright ownership. The ASF licenses this file | |
* to you under the Apache License, Version 2.0 (the | |
* "License"); you may not use this file except in compliance | |
* with the License. You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 |
......(Duplicate log 12124 lines) | |
/srv/flink-web/.rubydeps/ruby/2.5.0/gems/jekyll-multiple-languages-2.0.3/lib/jekyll-multiple-languages/multilang.rb:55:in `append_data_for_liquid' | |
/srv/flink-web/.rubydeps/ruby/2.5.0/gems/jekyll-multiple-languages-2.0.3/lib/jekyll-multiple-languages/document.rb:71:in `to_liquid' | |
/srv/flink-web/.rubydeps/ruby/2.5.0/gems/jekyll-4.1.1/lib/jekyll/drops/document_drop.rb:36:in `previous' | |
/srv/flink-web/.rubydeps/ruby/2.5.0/gems/jekyll-4.1.1/lib/jekyll/drops/drop.rb:47:in `public_send' | |
/srv/flink-web/.rubydeps/ruby/2.5.0/gems/jekyll-4.1.1/lib/jekyll/drops/drop.rb:47:in `[]' | |
/srv/flink-web/.rubydeps/ruby/2.5.0/gems/jekyll-4.1.1/lib/jekyll/drops/drop.rb:168:in `block in each' | |
/srv/flink-web/.rubydeps/ruby/2.5.0/gems/jekyll-4.1.1/lib/jekyll/drops/drop.rb:167:in `each' | |
/srv/flink-web/.rubydeps/ruby/2.5.0/gems/jekyll-4.1.1/lib/jekyll/drops/drop.rb:167:in `each' | |
/srv/flink-web/.rubydeps/ruby/2.5.0/gems/jekyll-4.1.1/lib/jekyll/drops/drop.rb:167:in `each' |
#!/bin/bash | |
git stash list | |
echo "Enter stash number to rename" | |
read stash_number | |
echo "Enter new name" | |
read new_name | |
stash_name="stash@{${stash_number}}" | |
echo "$stash_name" |
在用pandas.DataFrame.to_csv()方法时,如果使用默认编码或者指定编码为'utf-8'时中文会乱码。
import pandas as pd
df = pd.DataFrame()
df.to_csv(encoding='utf-8')
问题的根源在于文件开头没有BOM。
ORG=Awesome-Interview | |
curl -s https://api.github.com/orgs/$ORG/repos?per_page=200 | jq .[].clone_url | xargs -n 1 git clone | |
for REPO in * | |
do | |
cd $REPO | |
curl -s https://api.github.com/repos/$ORG/$REPO | jq .parent.clone_url | xargs -n 1 git remote add upstream | |
git fetch upstream | |
git checkout master |
在命令提示行中先输入
set HTTP_PROXY=127.0.0.1:1080
set HTTPS_PROXY=127.0.0.1:1080
然后再运行
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
"""Example of thread pool | |
https://docs.python.org/3/library/concurrent.futures.html | |
https://docs.python.org/3/library/multiprocessing.html | |
""" | |
import concurrent.futures as confu | |
import multiprocessing.pool as mpp | |
import time |
sudo env PATH=$PATH python
在“网易云音乐”的快捷方式上右击进入快捷方式“属性”选项卡中,在“目标”一栏的末尾添加--force-device-scale-factor=2
,其中2
为显示缩放比例(200%为2, 175%为1.75,以此类推)
然后进入“兼容性”选项卡,选择“更改高DPI设置”(17134版本),在“替代高DPI缩放行为。缩放执行”处选择“应用程序”,然后“确定”即可。
通过此快捷方式打开的网易云音乐界面缩放正常且不会模糊,但是托盘菜单由于仍然是Qt渲染的,因此字体会变得特别小。
参考: