Python Forum

Full Version: Confusion in exact term used for ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
import pandas as pd
diSales= { 2016:{'qtr1':34500,'qtr2':56000,'qtr3':47000,'qtr4':49000},
           2017:{'qtr1':44900,'qtr2':46100,'qtr3':57000,'qtr4':59000},
           2018:{'qtr1':54500,'qtr2':51000,'qtr3':57000,'qtr4':58500},
           2019:{'qtr1':61000}
         }
df = pd.DataFrame(diSales)
ks = df.count()
print(ks)
in above example i am using name df, ks but what exact term i will use for that: variable or object ?

are df and ks variables or anything ? plz clarify me
Technically its both because everything in python is an object and that a variable. But i would call it a DataFram object because its a pandas.core.frame.Dataframe class' object.
Strictly technically the term is name. Names point to objects (everything in python is object). But even the python documentation use sometime the term variable when refer to names. So if you use variable it would be understood what you mean.
See also
https://docs.python.org/3/reference/exec...nd-binding
https://nedbatchelder.com/text/names.html
https://stackoverflow.com/a/20700681/4046632