Skip to content

Tag: python

How to “describe” a column in pandas for python

I’m using pandas in python and I have a dataframe where one column is a timestamp and others contain data. The blue line stays constant for a while, then suddenly increases to zero, then at some point descends again to about -98 and stays there until it suddenly goes up to zero. What I need is a new col…

5-digit-year in date export (52164-01-19 00:00:00+00)

I received a data export from an unspecified source system, which includes dates in the format of: 52164-01-19 00:00:00+00 52992-08-12 04:29:36+00 52838-10-19 04:08:32.999936+00 54022-03-12 17:20:36.999936+00 I was told that the error is caused by a faulty conversion of unix to datetime (seconds and milliseco…

Export from .tif to .tif with another CRS

I write a code in python for processing some .tif files and put them to WGS 1984 Coordinate System. The problem is, when I run the code, it gave’s me error and stop executing. I try to do this with arcpy.ProjectRaster_management for almost 100 .tif files. Could you help me to make this script to run? Be…

Is it possible to improve my zigzag indicator loop?

I have read on SO and replicated an indicator for stock prices that works as intended. It’s called ZigZag and projects peaks and valleys on historical prices. I pass a pandas dataframe with OHLC prices to my ZigZag class. My problem is that it runs really slow, I have about 70 stocks with 10k rows each.…

Hashtables Python put method showing IndexError

Below is my SimpleHashTable class. The put(self, key) method should determines where the key is placed in the hashtable when a collision occurs (i.e., calculates the next available index position). Linear probing will be used for collision resolution. I am to do the the following steps: Invoke the get_hash_in…

How to Use jinja to render HTML without flask?

I need to render HTML page using jinja but without flask I read some other questions here but none had clear answer kindly let me know how can i achieve the same Here I need to render 1.html using 1.py – is it possble to do it in ofline mode current 1.py currently with this I am able to print