Category : Data

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

Introduction This article includes some Python functions for calculating the core climate extreme index. I post them here for my future reference, and share them with people who are interested in python or climate change. No guarantee of accuracy. The definitions of the core climate extreme indices 1.Description of Climate Extreme Indexes by OCDP 2.Definitions ..

Read more

On October 28, the total number of new cases of COVID19 worldwide set a record for a single day (530581/Day). More than 20 countries/regions added record new cases of COVID19. They are most European countries. Following coutries covid19 new cases hit record for a single day: #Italy #Germany #Ukraine #Belgium #Poland #Romania #Portugal #Lebanon #Azerbaijan ..

Read more

from pyspark.sql import SparkSession from pyspark.sql.types import * #data types from pyspark.sql import functions as F #functions spark=SparkSession.builder.appName(‘XIU-Daily’).getOrCreate() input_fn = ‘s-p-tsx-60-futures_01.csv’ df = spark.read.csv(input_fn,header=True,inferSchema=True) df.show(3) +——————-+—–+ | date|value| +——————-+—–+ |1999-09-07 00:00:00|416.5| |1999-09-08 00:00:00|417.2| |1999-09-09 00:00:00|421.5| +——————-+—–+ df=df.withColumn(‘Date’,F.date_format(‘date’,’yyyy-MM-dd’)) #change date format df=df.withColumn(‘current_date’,F.current_date()) #current date df=df.withColumn(‘year’,F.year(‘date’)) df=df.withColumn(‘month’,F.month(‘date’)) df=df.withColumn(‘dayofmonth’,F.dayofmonth(‘date’)) df=df.withColumn(‘minute’,F.minute(‘date’)) df=df.withColumn(‘second’,F.second(‘date’)) df=df.withColumn(‘dayofyear’,F.dayofyear(‘date’)) df=df.withColumn(‘dayofweek’,F.dayofweek(‘date’)) df=df.withColumn(‘weekofyear’,F.weekofyear(‘date’)) df=df.withColumn(‘quarter’,F.quarter(‘date’)) df=df.withColumn(‘next_day_Mon’,F.next_day(‘date’,’Mon’)) df=df.withColumn(‘next_day_Tue’,F.next_day(‘date’,’Tue’)) df=df.withColumn(‘next_day_Wed’,F.next_day(‘date’,’Wed’)) ..

Read more

GaussianModel Build-in model: GaussianModel(pdf) Build-in model: GaussianModel (CDF) LorentzianModel Build-in model: LorentzianModel(pdf) Build-in model: LorentzianModel (CDF) SplitLorentzianModel VoigtModel Build-in model: VoigtModel(pdf) Build-in model: VoigtModel (CDF) PseudoVoigtModel SkewedVoigtModel MoffatModel Build-in model:MoffatModel Pearson7Model Build-in model: Pearson7Model(pdf) StudentsTModel Build-in model: StudentsTModel(pdf) Build-in model: StudentsTModel (CDF) BreitWignerModel Build-in model: BreitWignerModel(pdf) LognormalModel Build-in model: LognormalModel(pdf) Build-in model: LognormalModel (CDF) DampedOcsillatorModel ..

Read more