-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have an issue (prettystyler object) #12
Comments
Hi, Thanks for using ZenTables! It is right now tested only with Jupyter Notebook/Lab. VSCode is not guaranteed to work (although it should). You don't need to use df.zen.pretty(font_size=12, font_family="Times New Roman") |
Thanks for the reply, |
Ah, you need to use Jupyter Notebook or Jupyter Lab. It will not work with the command line because ZenTables is based on the HTML output in Jupyter Notebook/Lab |
Great to know. I get this: when using df.zen.pretty. |
This error happens because the Pandas version is not compatible with zentables. You can try installing an earlier version of Pandas by doing Support for latest pandas versions will come out soon. |
Sadly i couldnt make it work. I appreciate the help and will try again, less close to a deadline. ;)) |
Hi, I am having trouble where i cant get get tables that i want to copy into word. I am just using the test data for now. It is the very last line of code.
I am using Visual studio code.
----------------------------------------INPUT----------------------------------------------------
import pandas as pd
import zentables as zen
zen.set_options(font_family="Times New Roman, serif", font_size=12)
demo_data = pd.read_csv("superstore.csv")
print(demo_data)
P = demo_data[["Segment", "Region"]].value_counts()
print(P)
df = demo_data.pivot_table(
index=["Segment", "Region"],
columns=["Category"],
values="Order ID",
aggfunc="count",
margins=True,
)
df
print(df)
new = df.zen.pretty(font_size=12, font_family="Times New Roman")
print(new)
------------------------------------------------OUTPUT---------------------------------------------
0 1 CA-2013-152156 11/9/2013 11/12/2013 ... 261.9600 2 0.00 41.9136
1 2 CA-2013-152156 11/9/2013 11/12/2013 ... 731.9400 3 0.00 219.5820
2 3 CA-2013-138688 6/13/2013 6/17/2013 ... 14.6200 2 0.00 6.8714
3 4 US-2012-108966 10/11/2012 10/18/2012 ... 957.5775 5 0.45 -383.0310
4 5 US-2012-108966 10/11/2012 10/18/2012 ... 22.3680 2 0.20 2.5164
... ... ... ... ... ... ... ... ... ...
9989 9990 CA-2011-110422 1/22/2011 1/24/2011 ... 25.2480 3 0.20 4.1028
9990 9991 CA-2014-121258 2/27/2014 3/4/2014 ... 91.9600 2 0.00 15.6332
9991 9992 CA-2014-121258 2/27/2014 3/4/2014 ... 258.5760 2 0.20 19.3932
9992 9993 CA-2014-121258 2/27/2014 3/4/2014 ... 29.6000 4 0.00 13.3200
9993 9994 CA-2014-119914 5/5/2014 5/10/2014 ... 243.1600 2 0.00 72.9480
[9994 rows x 21 columns]
Segment Region
Consumer West 1672
East 1469
Central 1212
Corporate West 960
East 877
Consumer South 838
Corporate Central 673
Home Office West 571
Corporate South 510
Home Office East 502
Central 438
South 272
dtype: int64
Category Furniture Office Supplies Technology All
Segment Region
Consumer Central 255 739 218 1212
East 303 888 278 1469
South 180 505 153 838
West 375 995 302 1672
Corporate Central 137 417 119 673
East 198 520 159 877
South 101 324 85 510
West 210 559 191 960
Home Office Central 89 266 83 438
East 100 304 98 502
South 51 166 55 272
West 122 343 106 571
All 2121 6026 1847 9994
<zentables.zentables.PrettyStyler object at 0x0000024C2997F850>
The text was updated successfully, but these errors were encountered: