Excel: assign label to scatter chart using specific cell values

ref: https://www.get-digital-help.com/custom-data-labels-in-x-y-scatter-chart/ Improve your X Y Scatter Chart with custom data labels Author: Oscar Cronquist Article last updated on February 25, 2019 The picture above shows a chart that has custom data labels, they are linked to specific cell values. What’s on this page How to apply custom data labels in Excel 2013 and later versions How to add data label shapes How to rearrange data labels Video Download Excel file Workaround for earlier Excel versions Excel Macro - Apply custom data labels Where to copy the code How to use macro Download Excel file This means that you can build a dynamic chart and automatically change the labels depending on what is shown on the chart.

READ MORE

reverse/inverse a mapping but with multiple values for each key

reverse/inverse a mapping but with multiple values for each key multi mappping dictionary , reverse/inverse ''' mrg_dictionary: {15: {16, 19, 21, 23}, 22: {18}} inv_merging_led_dict: {16: 15, 19: 15, 21: 15, 23: 15, 18: 22} mrg_dictionary --> inv_merging_led_dict ''' mrg_dictionary = {15: {16, 19, 21, 23}, 22: {18}} inv_merging_led_dict = {value:key for key in mrg_dictionary for value in mrg_dictionary[key]} print(inv_merging_led_dict) ''' inv_merging_led_dict: {16: 15, 19: 15, 21: 15, 23: 15, 18: 22} mrg_dictionary: {15: {16, 19, 21, 23}, 22: {18}} inv_merging_led_dict --> mrg_dictionary ''' valueset = set(inv_merging_led_dict.

READ MORE

compile and link C/CPP programs on Mac

ref: https://stackoverflow.com/questions/29987716/cannot-use-gsl-library-on-macos-ld-symbols-not-found-for-architecture-x86-6 Indeed, as @trojanfoe and @bergercookie said you have to compile your file and then link it to the library. As explained in compile and link, for that particular example: First compile the file: gcc -Wall -I/usr/local/include -c example.c -o example.o second, link it to the library: gcc -L/usr/local/lib example.o -lgsl -o example where of course, /usr/local/lib should be replaced for the path where you have gsl installed. The example file is excutable. EDIT: in macOS, from Yosemite the default location for the installation is /opt/local/lib (and /opt/local/include)

READ MORE

【GPU】Install CUDA on Mac

Install CUDA on Mac This instruction is following the Online Documentation for CUDA Toolkit. Some notifications for tf-gpu installation: After tf 1.2, the source code building becomes the only way of installation of TensorFlow-GPU in Mac OSX. link And tensorFlow nolonger support GPU on OSX. 这带来了很多安装的不确定性和难度。 从源码安装是可能的途径,但是有人制作whl放在网上供下载。github link python=3.6.5 CUDA=9.2.148 cuDNN=7.1.4 tf-gpu=1.9 可参考的一个配置选项,来自pyTorch社区 1.1 系统要求: Cuda 兼容的 GPU OSX 10.13 Clang 编译器 和 toolchain 安装自Xcode CUDA Toolkit: https://developer.nvidia.com/cuda-toolkit-archive Guided by: Online Documentation Xcode版本 9.2, Apple LLVM版本9.0.0, 如何检查: /usr/bin/cc --version 如何下载:https://developer.apple.com/download/more/

READ MORE

python代码执行bash命令 -- python3 cook book

python代码执行bash命令相关 – python3 cook book refer: https://python3-cookbook.readthedocs.io/zh_CN/latest/c13/p06_executing_external_command_and_get_its_output.html 执行外部命令并获取它的输出 问题 执行一个外部命令并以Python字符串的形式获取执行结果。 解决方案 使用 `subprocess.check_output()` 函数。例如: import subprocess out_bytes = subprocess.check_output(['netstat','-a']) 上段代码执行指定的命令,并将执行结果以字节字符串的形式返回。 如果你需要文本形式的返回,加一个解码步骤即可。例如: out_text = out_bytes.decode('utf-8') 如果被执行的命令以非零码返回,就会抛出异常。 下面的例子捕获错误并获取返回码: try: out_bytes = subprocess.check_output(['cmd','arg1','arg2']) except subprocess.CalledProcessError as e: out_bytes = e.output # Output generated before error code = e.returncode # Return code Quick Example Code: import subprocess cmd = ['netstat','-a'] try: out_bytes = subprocess.check_output(cmd) out_text = out_bytes.decode('utf-8') except subprocess.CalledProcessError as e: out_bytes = e.output # Output generated before error code = e.returncode # Return code More: check_output() 的几个参数 ☆check_output() 的stderr 参数: 默认情况下,check_output() 仅仅返回输入到标准输出的值。 如果你需要同时收集标准输出和错误输出,使用 stderr 参数:

READ MORE

twint 安装及使用

分享这个post是自己方便查,还有中文网界对这个东西介绍太少。 更多的就看github项目twint吧。 Installation: git+pip3: git clone https://github.com/twintproject/twint.git pip3 install -r requirements.txt pip3 install twint or pip3+pipenv: pip3 install --user --upgrade -e git+https://github.com/twintproject/twint.git@origin/master#egg=twint pipenv install -e git+https://github.com/twintproject/twint.git#egg=twint You may meet module cannot found error when you try to run twint after installation. On ubuntu, add ~/.local/bin into your PATH by: export PATH=$PATH:~/.local/bin You may edit ~/.bashrc file to permanately add the ‘~/.local/bin’ into your PATH. Usage: Running the twint cmd with arguments can give you results. A few simple examples to help you understand the basics:

READ MORE

【GPU】Install pyTorch GPU on Ubuntu16.04

Note: Contents below may out-of-date. But the procedures are referable. Avaliable version combinations for pyTorch/Tensorflow-gpu: python=3.6.5 CUDA=9.2.148 cuDNN=7.1.4 tf-gpu=1.9 python=3.6.5 CUDA=9.1.85 cuDNN=7.1.3 tf-gpu=1.8 CUDA=9.0.176 cudnn=7.3.1.20 tensorflow-gpu=1.12.0 CUDA=9.0; cuDNN=7.4.1 tensorflow-gpu=1.12.0; cuda=9.0; cudnn=7.5.0 tensorflow=1.8.0可以用的 python=3.6.7 cuda=9.0; cuDNN=7.4.2 tensorflow-gpu = 1.9.0 pytorch = 1.0.0 cuda=9.0; cudnn=7.0.5 ================= ================= Install: CUDA=9.0 CUDNN=7.0.5 http://www.twistedwg.com/2018/06/15/cuda9_cudnn7.html https://blog.csdn.net/lukaslong/article/details/81488219 ================= 注意python3, pip3, Follow pyTorch web: https://pytorch.org/get-started/locally/ UPDATE: sudo apt update sudo apt upgrade curl sudo apt-get install curl or: sudo apt install curl check: curl --version Anaconda curl -O https://repo.

READ MORE

【GPU】Install Tensorflow GPU with CUDA 10.1 for python on Windows

How to install Tensorflow GPU with CUDA 10.1 for python on Windows 在cuda 10.0的windows上安装Tensorflow GPU, python ref: https://www.pytorials.com/how-to-install-tensorflow-gpu-with-cuda-10-0-for-python-on-windows/ But the above link is too complicated and the success is not garanteed. Before start, Notations neet to know: 20190825: Note the cuda10.1 is NOT supported by pyTorch by now. Want pyTorch? recommend: cuda10.0 Install Tensorflow GPU with CUDA 10.1 for python on Windows Tasks (四位爷): Install visual studio Install Cuda (i.e., Cuda ToolKit) Install cuDNN Install tensorflow 那么问题是,这四位爷的版本得对上。 所以就有人做了这个东西:https://github.com/fo40225/tensorflow-windows-wheel 里面详细列出来每个安装包对应的四位爷的版本。follow this link to strictly keep the fix of versions.

READ MORE

【GPU】ubuntu 18.4 install GPU

put the below into inst_gpu.sh file: #!/bin/bash ## This gist contains step by step instructions to install cuda v9.0 and cudnn 7.2 in ubuntu 18.04 ### steps #### # verify the system has a cuda-capable gpu # download and install the nvidia cuda toolkit and cudnn # setup environmental variables # verify the installation # CUDA 9.0 requires NVIDIA driver version 384 or above ### ### to verify your gpu is cuda enable check lspci | grep -i nvidia ### gcc compiler is required for development using the cuda toolkit.

READ MORE