import causallearn_5a3219e as causallearn
# causallearn before Jun 16, 2022, where local_score_BIC is calculated using inner product
# download at https://github.com/py-why/causal-learn/tree/5a3219efa60f6d60387363358f6a97401d7546ce
from causallearn.utils.GraphUtils import GraphUtils
from causallearn.search.ScoreBased.GES import ges
import matplotlib.image as mpimg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# -*- coding: utf-8 -*- | |
import json, random, requests, math | |
from bs4 import BeautifulSoup | |
import numpy as np | |
header={ | |
'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36', | |
"Content-Type": "application/json; charset=utf-8", | |
} |
Given a non-negative integers array a
with different len(a)
(scale) and different max(a)
(amplitude), what is the most efficient way in Python to count the unique elements in a
?
In this experiment, we fix the scale len(a)
to be 20000, and focus specifically on the amplitude max(a)
of the array.
Here is the code:
def get_runtime_stat(AMPLITUDE:int):
def _test1():
counts = np.zeros((AMPLITUDE + 1, ), dtype=np.int32)
How to install numpy on M1 Max, with the most accelerated performance (Apple's vecLib)? Here's the answer as of Dec 6 2021.
So that your Python is run natively on arm64, not translated via Rosseta.
- Download Miniforge3-MacOSX-arm64.sh, then
- Run the script, then open another shell
$ bash Miniforge3-MacOSX-arm64.sh