- conda create -n my_env python=3.10
- conda activate my_env
- conda install jupyter
- which python (should point to the one from new environment)
- python -m ipykernel install --user --name="my_env" --display-name="my_env (Python 3.10)"
- jupyter kernelspec list
- !python3 -m jupyter kernelspec list (from notebook cell)
This file contains 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 | |
import numpy as np | |
# Create a sample DataFrame | |
data = {'category': ['A', 'A', 'B', 'B', 'A', 'B'], | |
'value': [10, 20, 15, 25, 30, 35]} | |
df = pd.DataFrame(data) | |
# Group by 'category' and apply multiple aggregation functions | |
agg_functions = { |
This file contains 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 | |
import numpy as np | |
# %matplotlib inline | |
import matplotlib.pyplot as plt | |
import matplotlib as mpl | |
#'https://s3-api.us-geo.objectstorage.softlayer.net/cf-courses-data/CognitiveClass/DV0101EN/labs/Data_Files/Canada.xlsx' | |
df = pd.read_excel('https://s3-api.us-geo.objectstorage.softlayer.net/cf-courses-data/CognitiveClass/DV0101EN/labs/Data_Files/Canada.xlsx', | |
sheet_name='Canada by Citizenship', | |
skiprows=range(20), |
This file contains 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 | |
import geopandas | |
from shapely.geometry import Point | |
from shapely.geometry.polygon import Polygon | |
#https://www.scb.se/vara-tjanster/oppna-data/oppna-geodata/deso--demografiska-statistikomraden/ | |
#https://www.scb.se/contentassets/923c3627a8a042a5b9215e8ff3bde0a3/deso_2018_v2.zip | |
countries_gdf = geopandas.read_file("DeSO_2018_v2.gpkg") |
This file contains 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 pyscbwrapper import SCB | |
import pandas as pd | |
import re | |
import requests | |
import json | |
session = requests.Session() | |
###########################Region############################# |
This file contains 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 | |
import requests | |
import json | |
session = requests.Session() | |
res = session.get("http://api.scb.se/OV0104/v1/doris/sv/ssd/START/BE/BE0101/BE0101A/BefolkningNy") | |
region_variables = json.loads(res.content.decode('utf-8-sig'))['variables'] | |
This file contains 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
git clone --bare https://github.com/user/repo.git | |
cd repo.git | |
_____________________________ | |
copy the below commmands to help.sh file and make it executable by running this command | |
chmod +x help.sh | |
./help.sh | |
________________________________________________________________________ | |
#!/bin/sh | |
This file contains 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
conda create -n tensorflow | |
conda activate tensorflow | |
pip install --ignore-installed --upgrade tensorflow | |
pip install jupyter notebook | |
pip install pandas |