Open omtarful opened 2 years ago
I ran into the same problem. Add this in request.py
after
result_df = df['value'].apply(lambda x: pd.Series(
str(x).replace('[', '').replace(']', '').split(',')))
:
formatted_df = df['formattedValue'].apply(lambda x: pd.Series(x))
for col in formatted_df.columns:
result_df.loc[formatted_df[col]=="<1",col]='1'
This is difficult to implement.
"<1" is not a valid numeric value, if we store it in the pd.DataFrame
we'll make processing the result significantly harder, I very much prefer to stick to a numeric type; on the other hand we're using an int
type to represent the value, which I think is correct given that all the values except "<1" can be represented as integers.
Given said that, we have two options here:
I think turning them into 0 is the most reasonable approach, however I'll let this issue opened in case someone thinks on a better solution.
When I perform this query on google trends some of the values returned are "<1", however pytrends is replacing the "<1" with 0. How can I make sure that it doesn't replace the <1 with 0 ?