Last answered:

08 May 2020

Posted on:

06 May 2020

0

Difference between data frame and variable in Python

Hi,
Which is the difference between defining a variable and a dataframe in Python? is it just the shape (since df will include an index)?

when w should opt for a data frame rather than a variable? and viceversa

1 answers ( 0 marked as helpful)
Instructor
Posted on:

08 May 2020

0
Hi Marta! Thanks for reaching out. А variable can contain a DataFrame. A variable is a placeholder/container for data values.  Then, you can assign many types of objects to a certain variable.  One type of object that you can assign to (and, thus, store in) a variable, is a pandas DataFrame. Other objects that you can store in variables are pandas Series, lists, tuples, integers, string values and many others. Hope this helps.
Best,
Martin

Submit an answer