Reputation: 133
I recently started coding a little bit in Python.
Given following data:
I just want to make a simple calculation with following code:
Why do I get the error message when I only have integers and not defined strings? I hope you can help me.
import pandas as pd
import quandl
df= quandl.get("FINRA/FORF_SYNVP", authtoken="sF7es4t9ozY6QjvZyL9M")
df=[['ShortVolume','TotalVolume']]
df['change_PCT']=(df['TotalVolume']-df['ShortVolume'])/df['ShortVolume']*100
df=df[['change_PCT','ShortVolume']]
print(df.head())
Edit: I've tried to type in the code using ´enter the code´ or the Ctrl+K combination but I always receive a error message...
Upvotes: 2
Views: 75
Reputation: 17322
you are assigning in the 5th line for df
variable a list, the error is legitim, just delete the 5th line
Upvotes: 1