python C:\Users\ferna\AppData\Local\Programs\Python\Python38\Tools\i18n\pygettext.py -d base -o locales/base.pot app.py
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 pandas as pd | |
def generate_insert_queries_for_data_layers_v2(df, num_rows, column_mappings): | |
''' | |
Generate SQL insert queries from a DataFrame for the DataLayersInfo table. | |
It carries forward layer_category and layer_subcategory when they are not explicitly mentioned in every row. | |
:param df: DataFrame containing the data. | |
:param num_rows: Number of rows to generate queries for. | |
:param column_mappings: Dictionary mapping excel column names to table attribute names. |
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 os | |
import psycopg2 | |
import geopandas as gpd | |
import rasterio | |
import numpy as np | |
from rasterio.features import rasterize, shapes | |
from rasterio.transform import from_bounds | |
from sqlalchemy import create_engine | |
from dotenv import load_dotenv | |
from skimage import measure |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
import geopandas as gpd | |
import numpy as np | |
from scipy.spatial import cKDTree | |
from scipy.ndimage import gaussian_filter | |
from osgeo import gdal, osr, ogr | |
from shapely.geometry import Point | |
from matplotlib.pyplot import imshow, show, colorbar | |
def scale(im, nR, nC): | |
nR0 = len(im) # source number of rows |
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
df_90_sand = pd.DataFrame({'Depth': [20,40,60,80,100,120,140,160,180,200], | |
'LL15': [0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04], | |
'DUL': [0.12,0.12,0.12,0.12,0.12,0.12,0.12,0.12,0.12,0.12]}) | |
df_65_sand = pd.DataFrame({'Depth': [20,40,60,80,100,120,140,160,180,200], | |
'LL15': [0.09,0.09,0.09,0.09,0.084,0.084,0.084,0.08,0.08,0.08], | |
'DUL': [0.22,0.22,0.22,0.22,0.208,0.208,0.208,0.2,0.2,0.2]}) | |
df_70_sand = pd.DataFrame({'Depth': [20,40,60,80,100,120,140,160,180,200], |
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 streamlit as st | |
from streamlit.delta_generator import DeltaGenerator | |
def display_centered_text(text: str, container: Optional[DeltaGenerator] = None): | |
if container is not None: | |
container.markdown( | |
f"<div style='text-align: center;'>{text}</div>", | |
unsafe_allow_html=True) |
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
# imports | |
import pandas as pd | |
import plotly.graph_objects as go | |
from datetime import datetime | |
import plotly.express as px | |
# data | |
open_data = [33.0, 33.3, 33.5, 33.0, 34.1] | |
high_data = [33.1, 33.3, 33.6, 33.2, 34.8] | |
low_data = [32.7, 32.7, 32.8, 32.6, 32.8] |
NewerOlder