sudo apt-get install libopenblas-dev
sudo apt-get install liblapacke-dev
sudo apt-get install liblapacke
sudo apt-get install libopenblas-serial-dev
sudo apt-get install libopenblas0-serial
sudo apt-get install libopenblas0
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
| [project] | |
| name = "huggingface" | |
| version = "0.1.0" | |
| description = "Add your description here" | |
| readme = "README.md" | |
| requires-python = ">=3.12" | |
| dependencies = [ | |
| "torch>=2.7.0", | |
| "torchvision>=0.22.0", | |
| ] |
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
| library(rextendr) | |
| rust_source( | |
| code = readLines("r-ndarray-eigendecomposition.rs"), | |
| dependencies = list("ndarray-linalg" = "0.17.0"), | |
| features = "ndarray", | |
| profile = "dev" | |
| ) | |
| X_dim <- 5 |
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
| library(rextendr) | |
| rust_source( | |
| code = readLines("r-faer-eigendecomposition.rs"), | |
| dependencies = list("faer" = "0.22.6"), | |
| features = "faer", | |
| profile = "release" | |
| ) | |
| X <- matrix(rnorm(n = 25), 5, 5) |
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
| library(rextendr) # Version 0.4.0 | |
| rust_code <- r"( | |
| use faer::prelude::*; | |
| use extendr_api::prelude::*; | |
| #[extendr] | |
| fn return_matrix(X: RMatrix<f64>) -> RMatrix<f64> { | |
| let A: Mat<f64> = Mat::from_fn(X.nrows(), X.ncols(), |row, col| X[[row, col]]); | |
| let result: RMatrix<f64> = RMatrix::new_matrix(A.nrows(), A.ncols(), |row, col| A[(row, col)]); |
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
| import polars as pl | |
| import pandas as pd | |
| # Read input data as a data frame with two columns | |
| input = pl.from_pandas( | |
| pd.read_table("day-1/input", sep = " ", header = None, | |
| names = ["list_1", "list_2"]) | |
| ) | |
| # Sort each column separately, |
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
| read.table("day-1/input", col.names = c("list_1", "list_2")) |> | |
| apply(MARGIN = 2, sort) |> | |
| apply(MARGIN = 1, FUN = \(x) abs(x[2] - x[1])) |> | |
| sum() |
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
| library(dplyr) | |
| library(tidyr) | |
| library(survey) | |
| # Load example data | |
| # 'apipop' has one row per school | |
| data('api', package = 'survey') | |
| # Draw a sample of school districts |
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
| library(dplyr) | |
| library(broom) | |
| library(tidyr) | |
| # Make example data | |
| my_data <- data.frame(x = sample(1:5, size = 10, replace = TRUE), | |
| y = sample(1:5, size = 10, replace = TRUE)) | |
| # Generate every pair of variables | |
| var_list <- colnames(my_data) |
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
| describe_design( | |
| srs_stage(id = "PSU_ID", method = "SRS", | |
| stratum = "PSU_STRATUM_ID"), | |
| nonresponse_stage(response_indicator = "PSU_RESPONDENT"), | |
| pps_stage(id = "SSU_ID", method = "PPS", | |
| stratum = "SSU_STRATUM_ID"), | |
| nonresponse_stage(response_indicator = "SSU_RESPONDENT") | |
| ) |
NewerOlder