Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| sepal_length | sepal_width | petal_length | petal_width | species | |
|---|---|---|---|---|---|
| 5.1 | 3.5 | 1.4 | 0.2 | setosa | |
| 4.9 | 3.0 | 1.4 | 0.2 | setosa | |
| 4.7 | 3.2 | 1.3 | 0.2 | setosa | |
| 4.6 | 3.1 | 1.5 | 0.2 | setosa | |
| 5.0 | 3.6 | 1.4 | 0.2 | setosa | |
| 5.4 | 3.9 | 1.7 | 0.4 | setosa | |
| 4.6 | 3.4 | 1.4 | 0.3 | setosa | |
| 5.0 | 3.4 | 1.5 | 0.2 | setosa | |
| 4.4 | 2.9 | 1.4 | 0.2 | setosa |
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
| from typing import Dict, Union | |
| from huggingface_hub import get_safetensors_metadata | |
| import argparse | |
| import sys | |
| # Example: | |
| # python get_gpu_memory.py Qwen/Qwen2.5-7B-Instruct | |
| # Dictionary mapping dtype strings to their byte sizes | |
| bytes_per_dtype: Dict[str, float] = { |
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
| ```dataviewjs | |
| // Adicione uma caixa de seleção HTML para escolher a variável de filtro | |
| const filterVariableSelect = document.createElement("select"); | |
| filterVariableSelect.innerHTML = ` | |
| <option value="Proudness">Proudness</option> | |
| <option value="Writing">Writing</option> | |
| <!-- Adicione mais opções conforme necessário --> | |
| `; | |
| this.container.appendChild(filterVariableSelect); |
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
| image=icons_finance01_new.jpg | |
| size=$( identify -ping -format "%wx%h" "${image}" ) | |
| x_upb=${size%x*} | |
| y_upb=${size#*x} | |
| x_inc=350 | |
| y_inc=350 | |
| x_tile=350 | |
| y_tile=350 |
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
| # Create a correlation matrix | |
| corr_metrics = df.corr() | |
| corr_metrics.style.background_gradient() |
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
| def load_geom_labels(shp: Path): | |
| from osgeo import ogr; ogr.UseExceptions() | |
| ''' | |
| Read a .shp file and return rowidx, ID Field and geom. | |
| returns dictionary | |
| ''' | |
| ogr_ds = ogr.Open(str(shp)) | |
| ogr_lyr = ogr_ds.GetLayer() |
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 pyproj | |
| import shapely | |
| from shapely.ops import transform | |
| def reproj_polygon(geometry:shapely.geometry): | |
| wgs84 = pyproj.CRS('EPSG:4326') | |
| utm_sirgas_2000 = pyproj.CRS('EPSG:4674') | |
| project = pyproj.Transformer.from_crs(wgs84, utm_sirgas_2000, always_xy=True).transform |
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
| ## Reduce memory usage | |
| def reduce_mem_usage(df, verbose=True): | |
| numerics = ['int16', 'int32', 'int64', 'float16', 'float32', 'float64'] | |
| start_mem = df.memory_usage().sum() / 1024**2 | |
| for col in df.columns: | |
| col_type = df[col].dtypes | |
| if col_type in numerics: | |
| c_min = df[col].min() | |
| c_max = df[col].max() | |
| if str(col_type)[:3] == 'int': |
NewerOlder