What do you want to save?
Add Code snippet
New code examples
-
Python 2021-09-04 18:15:03
var colors python
#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime from colorama import init init(autoreset=True) from fabric.colors import red, green latitude = 36.02866 longitude = 70.77258 print ("\033[92m" + 'I know I can be green' + "\0... Add solution -
Python 2021-09-04 16:06:01
make pandas dataframe from elasticsearch
from datetime import datetime from elasticsearch import Elasticsearch from pandas import DataFrame, Series import pandas as pd import matplotlib.pyplot as plt es = Elasticsearch(host="192.168.121.252") res = es.search(index="_all", doc... Add solution -
Python 2021-09-03 20:46:02
python time format
The program below converts a datetime object containing current date and time to different string formats. Code: from datetime import datetime now = datetime.now() # current date and time year = now.strftime("%Y") print("year:", ... Add solution -
Python 2021-08-31 15:09:01
change ticks font size matplotlib python
from matplotlib import pyplot as plt from datetime import datetime, timedelta xvalues = range(10) yvalues = xvalues fig,ax = plt.subplots() plt.plot(xvalues, yvalues) plt.xticks(fontsize=16) # sets font size of xticks to 16 (respective of yticks) plt.... Add solution -
Other 2021-08-31 13:48:02
spark get year from date
import datetime from pyspark.sql.functions import year, month, dayofmonth elevDF = sc.parallelize([ (datetime.datetime(1984, 1, 1, 0, 0), 1, 638.55), (datetime.datetime(1984, 1, 1, 0, 0), 2, 638.55), (datetime.datetime(1984, 1, 1, 0, 0), 3, 6... Add solution