Advertisements
Advertisements
प्रश्न
>>> import pandas as pd
>>> dFrameEmt = pd.DataFrame()
>>> dFrameEmt
Empty DataFrame
Columns: []
Index: []
What would happen if we pass 3 columns or 5 columns instead of 4 in the above code? What is the reason?
कारण सांगा
Advertisements
उत्तर
- In the given code, if we pass 3 columns or 5 columns instead of 4, an error will occur because the DataFrame does not have matching column labels.
- The number of column names must be equal to the number of columns in the DataFrame. If the numbers do not match, Pandas cannot create the DataFrame properly.
shaalaa.com
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
