AnkitDoshi

Share me a screenshot of record. Losing Column heads is something i have came accross when converting arrays to a dataframe. Anyways share a screenshot of the code and array once

About

Username
AnkitDoshi
Joined
Visits
4
Last Active
Roles
Member

Activity

  • Sashank_Chittipeddi
    Hello Ankit,

    I have a similar query to the one you had regarding getting 5 min/ 15 min live data. Can you help me out - a sample code?
    February 2018
  • giripra
    I am looking for a programmer to code and backtest my strategy, please could you send me an SMS or Whatsapp on 9008520088?
    April 2017
  • Share me a screenshot of record.
    Losing Column heads is something i have came accross when converting arrays to a dataframe.
    Anyways share a screenshot of the code and array once
    December 2016
  • itsram90
    Array=record
    df=pd.DataFrame(Array)

    then i am getting below error :
    raise ValueError('If using all scalar values, you must pass'
    ValueError: If using all scalar values, you must pass an index

    i tried below but with below code i am loosing my index and "high", "close" etc index are not working


    df=pd.DataFrame({"key": RecordArray.keys(), "value": RecordArray.values()})

    is there any way by which i can pass index under Array variable or record variable in pandas dataframe?

    December 2016
  • I m not much into numpy. So dont know that much.
    But you can try something like this-

    for i in range(0, len(df['low']): # loop that goes through first candle till last
    if df['low'][i]< df['low'][i-1]: # Current low less than previous low
    blah blah blah # write your logic


    There is one way to convert array to a dataframe


    array=Data of array # array is the variable in which we have stored the data of array

    import pandas as pd
    # lets create a variable Stock1
    Stock1 = pd.DataFrame(array)



    Stock1 will now be in a Time series format.
    December 2016
  • itsram90
    Ankit will record["low"-1] will work to get the low of previous candle in python if record is array and low is index ?
    December 2016