0
Dataframe has no columns
I took a dataset to parse it with Pandas, but when I write data.colums I get the error "'DataFrame' object has no attribute 'colums'" and when I try to create a table I get "TypeError: crosstab () missing 1 required positional argument: 'columns' ", when I checked, I found that my other datasets give such errors, although they worked fine before, I did not find such a case on the Internet, but there are many similar ones, however, the solutions that were offered there did not help
8 odpowiedzi
+ 2
could you post your code? what dataset are you using?
it's hard to help you without seeing the code.
0
should be:
data.columns not colums you misspelled it.
0
I have a terrible feeling of shame, I did not think that I would make such a gross language mistake, I'm an idiot
0
lol, don't worry it happens to everyone.
0
it was a really stupid mistake but it didn’t remove the error when calling the table "crosstab () missing 1 required positional argument: 'columns'"
0
crosstab() takes two arguments, you just provided one
pd.crosstab(data['gender'], margins=True)
what's the other tab you want to cross with gender
0
it looks like I misunderstood, I translated gender from object into bool before, and thought that the tabular would sort it automatically, in which case I will simply separate gender into two separate signs