Hi,

I am new to django.

MyTask:
======
while handling asynchronous task in Django using celery i need to export 
some data to excel and need to create a pivotal table from it,
I am using "crosstab" in pandas.[ 
https://pandas.pydata.org/pandas-docs/version/0.17.0/generated/pandas.crosstab.html
 ]

*I have a data frame[df] like below:*
*df :*

# read the specific columns from an excel file.
require_cols = ['ID', 'Category', 'PatchLeve1', 'HQ Domain Owners', 
'LGSIDomainOwners', 'Ownershipstatus']

# only read the specific columns from an excel file.
df = pd.read_excel(excel_name, use_cols=require_cols)


SerialNo RecordId Category SecurityPatchLevel Applicability Description 
GSP_ID HQDomainOwners LGSIDomainOwners OwnerShipStatus 
1 16 Google Security Patch 2019-02-01 O https://www.collab.com/en/20 
CVE_2019_201920 IT1 IT1   
2 17 Google Security Patch 2019-02-01 O https://www.collab.com/en/21 
CVE_2019_201921 Connectivity-GPS Connectivity-GPS   
3 18 Google Security Patch 2019-02-01 O https://www.collab.com/en/22 
CVE_2019_201922 Media-Framework MM   


===========================================================================================================
while executing below statement, cross tab i am getting *TypeError: 
crosstab() missing 1 required positional argument: 'columns'*
===========================================================================================================

*gsp_pivoted_table= pd.crosstab([df.Category,df.LGSIDomainOwners],margins=True)*

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

print("crosstab for LGSIDomainOwner and ownership status Count")
gsp_pending_notification = 
pd.crosstab([df.LGSIDomainOwners,df.OwnerShipStatus], margins=True)

return gsp_pivoted_table, gsp_pending_notification;


==========================================================================================================



Please let us know how to proceed further.


Regards,
N.Dilip Kumar.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/df08beb7-379f-4a7e-89ca-d5255da18872%40googlegroups.com.

Reply via email to