¡@

Home 

python Programming Glossary: ts

Resample hourly TimeSeries with certain starting hour

http://stackoverflow.com/questions/12579150/resample-hourly-timeseries-with-certain-starting-hour

index date_range datetime 2012 1 1 17 freq 'H' periods 60 ts Series data 1 60 index index ts.resample rule 'D' how 'sum'.. 1 1 17 freq 'H' periods 60 ts Series data 1 60 index index ts.resample rule 'D' how 'sum' closed 'left' label 'left' Result.. Resample has an base argument which covers this case ts.resample rule '24H' how 'sum' closed 'left' label 'left' base..

From a timezone and a UTC time, get the difference in seconds vs local time at that point in time

http://stackoverflow.com/questions/12691081/from-a-timezone-and-a-utc-time-get-the-difference-in-seconds-vs-local-time-at-t

Python. I want to have a function which takes two arguments a UTC time in seconds and a zoneinfo name like 'Europe Vienna'.. const time_t original_utc_time struct tm ts ts localtime original_utc_time return mktime ts original_utc_time.. const time_t original_utc_time struct tm ts ts localtime original_utc_time return mktime ts original_utc_time..

Converting between datetime, Timestamp and datetime64

http://stackoverflow.com/questions/13703720/converting-between-datetime-timestamp-and-datetime64

code I create a datetime timestamp and datetime64 objects. import datetime import numpy as np import pandas as pd dt datetime.datetime.. to extract a Timestamp object there's surely a better way ts pd.DatetimeIndex dt 0 dt64 np.datetime64 dt In 7 dt Out 7 datetime.datetime.. dt In 7 dt Out 7 datetime.datetime 2012 5 1 0 0 In 8 ts Out 8 Timestamp 2012 05 01 00 00 00 In 9 dt64 Out 9 numpy.datetime64..

How to filter (or replace) unicode characters that would take more than 3 bytes in UTF-8?

http://stackoverflow.com/questions/3220031/how-to-filter-or-replace-unicode-characters-that-would-take-more-than-3-bytes

the unicode character set at Stack Overflow EDIT Added tests about the proposed solutions So I got good answers so far. Thanks.. and fastest one. # usr bin env python # coding utf 8 # vi ts 4 sw 4 et import cProfile import random import re # How many.. filter_using_python test_string .encode 'utf8' The results filter_using_re did 515 function calls in 0.139 CPU seconds..

plotting unix timestamps in matplotlib

http://stackoverflow.com/questions/4090383/plotting-unix-timestamps-in-matplotlib

I have read answers about plotting with datetime objects but this method seems to remove hour min sec information and.. to the full day. Is there a way to generate these plots and show more granular labels python matplotlib share improve.. values with dates being a list of datetime.datetime objects. The plot will include xticks in a format like ' Y m d' and..

Use binary COPY table FROM with psycopg2

http://stackoverflow.com/questions/8144002/use-binary-copy-table-from-with-psycopg2

id serial PRIMARY KEY NOT NULL node integer NOT NULL ts smallint NOT NULL val1 real val2 double precision Here is where.. repr x for x in num_row ' n' # Insert data database converts text back to floating point numbers cpy.seek 0 curs.copy_from.. cpy.seek 0 curs.copy_from cpy 'num_data' columns 'node' 'ts' 'val1' 'val2' conn.commit Is there an equivalent that could..