Category : matplotlib

——Exploring the “Ontario Climate Change Data Portal”: A Case Study in Data Exploration Prompts searchable table Examples Download csv file from internet ChatGPT prompt I want you to act as a Python developer tasked with downloading a CSV file from the internet using the provided URL: https://lamps.math.yorku.ca/OntarioClimate/data/content/grids/Historical/Monthly_2m_temperature_8964_ERA5_January1981toMarch2021.csv. To accomplish this, write a Python script that ..

Read more

The popular initializers include RandomNormal distribution function, trancated normal distribution function, GlorotNormal function, HeNormal function and others. This example code show what are these functions and display the probability density functions of these initializers for my reference. Code: import numpy as np import matplotlib.pyplot as plt from scipy.stats import norm x = np.linspace(-10,10,500) #default RandomNormal(mean=0.0, ..

Read more

photograph of a frozen sparkling lake

Activation function is a very important component of machine learning and deep learning. There are three types of Activation Functions: Binary Step Function; Linear Activation Function and Non-Linear Activation Functions. Available activation functions in Keras include relu, sigmoid, softmax, softplus, softsign, tanh, selu, elu and exponential. In addition,user can also create custom activation function.Below is an ..

Read more

If you have grid or point data and polygon shapefiles for longitude and longitude. Using geopandas and shapely it’s easy to find grids or points in specific polygons. import geopandas as gpd import pandas as pd import numpy as np import matplotlib.pyplot as plt from shapely.geometry import Point # US state polygon shape file US_states=gpd.GeoDataFrame.from_file(‘states_province_shapefile\cb_2018_us_state_20m\cb_2018_us_state_20m.shp’) ..

Read more

My example of Python code for mapping variables overlay with geographic information. Elements in the map include ocean, coastline,borders,lakes,rivers,province borders, contour, contourf, pcolormesh, scatter, labels, province (or state) names. Also includes information about how to set cmap, what range of the data (minimum, maximum) to show, how many levels to display the data. How to ..

Read more