How to determine Vedic Astrology (Ascendant) in Swiss Ephemeris Library

For those who have faced this problem before and for new programmers who maybe attempting this, here is a pro tip for determining the Vedic/Jyotish astrology ascendant (Lagna) in Swiss Epheremis.

From the documentation on ascendants in Swiss Ephemeris:

In the array ascmc, the function returns the following values:
ascmc[0] =      Ascendant
ascmc[1] =     MC
ascmc[2] =     ARMC
ascmc[3] =     Vertex
ascmc[4] =     "equatorial ascendant"
ascmc[5] =     "co-ascendant" (Walter Koch)
ascmc[6] =     "co-ascendant" (Michael Munkasey)
ascmc[7] =     "polar ascendant" (M. Munkasey)

In particular we want the equatorial ascendant ascmc[4] = "equatorial ascendant". Why the equatorial ascendant? To answer that here is a quote from Wiki:

In astrology, the Equatorial Ascendant, or the East Point, is the sign and degree rising over the Eastern Horizon at the Earth’s equator at any given time. It is the point where the Earth’s equator intersects the ecliptic.

Finally here is an example using PySwissEph, the Python Language extension for Swiss Ephemeris:

    ### SET POSITION
    lat = 27.1750
    lon = 78.0419

    ### SET AYANAMSA MODE
    set_ayanamsa_mode = lambda: swe.set_sid_mode(swe.SIDM_LAHIRI, 0, 0)
    set_ayanamsa_mode()

    ### DATE INFORMATION    
    year = 2015
    month = 3
    day = 20
    hour = 19
    minute = 25

    hour = str(hour) + "." + str(minute)

    ### DATE INFORMATION FOR LIBRARY
    jd = swe.date_conversion(year, month, day, float(hour), 'g')
    jd = float(jd[1])

    ### ASCENDANT
    ayanamsa = float(swe.get_ayanamsa_ut(jd))
    lagna = float(swe.houses_ex(jd, lat, lon, 'E', flag = swe.FLG_SIDEREAL)[0][4])
    ascSign = (lagna / 30)