Category : dataframe

I’m trying to get the RSI of a stock using TA-Lib in python and it keeps giving me wrong numbers. import talib import pandas as pd from td.client import TDClient ticker = ‘GOOG’ data = TDSession.get_price_history( symbol = ticker, period_type = ‘month’, frequency_type = ‘daily’, frequency = 1, period = 1, ) df = pd.DataFrame(data[‘candles’]) ..

Read more

I am using if condition in python to perform a calculation but I am getting The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all(). error Can someone please help me in understanding how to perform actions on a dataframe based on if condition on other columns? if (simulated_hour[‘Weeknnd’] == ..

Read more

Hi I have a list of dataframes that I want calculate certain columns value length and create a new columns for the calculated values. columns = [‘name’, ‘address’, ’email’] newcolumns = [‘name_length’, ‘address_length’, ’email_length’] def length(start, i, j): while i < len(columns): newcol = newcolumns[i] col = columns[j] df_list[start][newcol] = df_list[start][col].str.len() i += 1 j ..

Read more