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

1st Oct 2020, 8:14 AM
Даня Слобяк
Даня Слобяк - avatar
8 odpowiedzi
+ 2
could you post your code? what dataset are you using? it's hard to help you without seeing the code.
1st Oct 2020, 8:22 AM
Bahhaⵣ
Bahhaⵣ - avatar
0
should be: data.columns not colums you misspelled it.
1st Oct 2020, 5:31 PM
Bahhaⵣ
Bahhaⵣ - avatar
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
1st Oct 2020, 7:44 PM
Даня Слобяк
Даня Слобяк - avatar
0
lol, don't worry it happens to everyone.
1st Oct 2020, 7:46 PM
Bahhaⵣ
Bahhaⵣ - avatar
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'"
1st Oct 2020, 7:53 PM
Даня Слобяк
Даня Слобяк - avatar
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
1st Oct 2020, 8:46 PM
Bahhaⵣ
Bahhaⵣ - avatar
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
1st Oct 2020, 8:56 PM
Даня Слобяк
Даня Слобяк - avatar