मैं एक पांडा डेटाफ्रेम मुद्रित करने का प्रयास कर रहा हूं। कॉलम में से एक बहुत व्यापक है (यह एक बहुत लंबी स्ट्रिंग है)। प्रिंट करने के लिए मैं tabulate
लाइब्रेरी का उपयोग कर रहा हूं। लेकिन जब इसे मुद्रित किया जाता है तो यह सभी कॉलम की पूरी सामग्री को एक बहुत लंबी लाइन में दिखाता है। यहां मैं देख रहा हूं:पायथन: पांडों के मुद्रित कॉलम की चौड़ाई को सीमित करें डेटाफ्रेम
row name review rating
0 Planetwise Flannel Wipes These flannel wipes are OK, but in my opinion not worth keeping. I also ordered someImse Vimse Cloth Wipes-Ocean Blue-12 countwhich are larger, had a nicer, softer texture and just seemed higher quality. I use cloth wipes for hands and faces and have been usingThirsties 6 Pack Fab Wipes, Boyfor about 8 months now and need to replace them because they are starting to get rough and have had stink issues for a while that stripping no longer handles. 3
1 Planetwise Wipe Pouch it came early and was not disappointed. i love planet wise bags and now my wipe holder. it keps my osocozy wipes moist and does not leak. highly recommend it. 5
2 Annas Dream Full Quilt with 2 Shams Very soft and comfortable and warmer than it looks...fit the full size bed perfectly...would recommend to anyone looking for this type of quilt 5
3 Stop Pacifier Sucking without tears with Thumbuddy To Love\'s Binky Fairy Puppet and Adorable Book This is a product well worth the purchase. I have not found anything else like this, and it is a positive, ingenious approach to losing the binky. What I love most about this product is how much ownership my daughter has in getting rid of the binky. She is so proud of herself, and loves her little fairy. I love the artwork, the chart in the back, and the clever approach of this tool. 5
4 Stop Pacifier Sucking without tears with Thumbuddy To Love\'s Binky Fairy Puppet and Adorable Book All of my kids have cried non-stop when I tried to ween them off their paci
जैसा कि आप देख सकते हैं कि रेखा बहुत लंबी है। मुद्रित स्ट्रिंग में वर्णों की संख्या को मैं कैसे सीमित कर सकता हूं? उदाहरण के लिए मुझे लगता है कि 3 लाइन कुछ इस तरह के रूप में मुद्रित करने के लिए करना चाहते हैं:
3 Stop Pacifier Sucking without tears ... This is a product well worth ... 5
मैं इस सीमा तालिका में सभी लाइनों के लिए लागू किया जाना चाहता हूँ।
धन्यवाद एंडी, मैं 'tabulate' साथ इन विकल्पों का उपयोग करने की कोशिश की है, और वे काम नहीं किया। अगर मैं एक पंक्ति में सभी कॉलम देखना चाहता हूं लेकिन लाइनों को सिर्फ डीएफ टाइप करके (टैब्यूलर का उपयोग नहीं कर रहा है) तो मुझे कुछ ऐसा करने की ज़रूरत है: pd.options.display.width = 200 pd.options.display.max_colwidth = 50 – TJ1
अधिकतम चौड़ाई बहुत बड़ी है, अगर मैं आपको समझता हूं, तो 500 कहें। यह सब एक ही पंक्ति पर रखेगा। –