I am able to convert a csv file to pandas DataFormat and able to print out the table, as seen below. However, when I try to print out the Height column I get an error. How can I fix this?
import pandas as pd
df = pd.read_csv('/path../NavieBayes.csv')
print df #this prints out as seen below
print df.Height #this gives me the "AttributeError: 'DataFrame' object has no attribute 'Height'
Height Weight Classifer
0 70.0 180 Adult
1 58.0 109 Adult
2 59.0 111 Adult
3 60.0 113 Adult
4 61.0 115 Adult
asked Jan 27, 2015 at 4:48
3
I have run into a similar issue before when reading from csv
. Assuming it is the same:
col_name =df.columns[0]
df=df.rename(columns = {col_name:'new_name'})
The error in my case was caused by (I think) by a byte order marker in the csv or some other non-printing character being added to the first column label. df.columns
returns an array of the column names. df.columns[0]
gets the first one. Try printing it and seeing if something is odd with the results.
answered Jan 27, 2015 at 4:56
JABJAB
12.3k6 gold badges44 silver badges49 bronze badges
0
PS On above answer by JAB — if there is clearly spaces in your column names use skipinitialspace=True in read_csv e.g.
df = pd.read_csv(‘/path../NavieBayes.csv’,skipinitialspace=True)
answered Jul 18, 2017 at 13:37
df = pd.read_csv(r'path_of_filecsv_file_name.csv')
OR
df = pd.read_csv('path_of_file/csv_file_name.csv')
Example:
data = pd.read_csv(r'F:Desktopdatasetshackathon+data+set.csv')
Try it, it will work.
Tim Diekmann
7,57711 gold badges41 silver badges67 bronze badges
answered Jul 30, 2018 at 20:25
tulsi kumartulsi kumar
9668 silver badges6 bronze badges
- 0
Несоответствие стандарта и написанного кода
Asked by
WabFad,
January 12, 2011
-
Answer this question
-
Ask a question
Question
-
- Report
- Share
Сильно не бейте плиз если нублю, проблема в следующем, стандарт на сайте XHTML 1.0.
валидатор выдает 20 ошибок типа:
Line 51, Column 33: there is no attribute «height»
<table width=»100%» height=»133″ border=»0″ cellpadding=»0″ cellspacing=»…
You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the «Strict» document type with a document that uses frames (e.g. you must use the «Transitional» document type to get the «target» attribute), or by using vendor proprietary extensions such as «marginheight» (this is usually fixed by using CSS to achieve the desired effect instead).
This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.
How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash.
или вот например:
Line 506, Column 74: element «noindex» undefined
…h3> <div class=»textwidget»><noindex><center><!—LiveInternet counter—><scr…
✉
You have used the element named above in your document, but the document type you are using does not define an element of that name. This error is often caused by:
incorrect use of the «Strict» document type with a document that uses frames (e.g. you must use the «Frameset» document type to get the «<frameset>» element),
by using vendor proprietary extensions such as «<spacer>» or «<marquee>» (this is usually fixed by using CSS to achieve the desired effect instead).
by using upper-case tags in XHTML (in XHTML attributes and elements must be all lower-case).
насколько я понял это проблема в стандарте, однако, если я изменяю стандарт, то ошибок становится в разы больше, подскажите как можно исправить ситуацию?
- Quote
Link to comment
Share on other sites
Recommended Posts
- 0
-
- Report
- Share
height=»133″
Пиксели указывать надо. height=»133px».
- Quote
Link to comment
Share on other sites
- 0
- Author
-
- Report
- Share
Не помогло
there is no attribute "height"
<table width="100%" height="133px" border="0px" cellpadding="0" cellspaci…
You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.
How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash.
Edited January 12, 2011 by WabFad
- Quote
Link to comment
Share on other sites
- 0
-
- Report
- Share
В XHTML у таблицы нет атрибута height, пиксели здесь не причем. Тега <noindex> вообще ни в одном стандарте нет. Чтобы ссылки не индексировались, к ссылкам надо добавить rel=»nofollow».
- Quote
Link to comment
Share on other sites
- 0
-
- Report
- Share
В XHTML у таблицы нет атрибута height, пиксели здесь не причем. Тега <noindex> вообще ни в одном стандарте нет. Чтобы ссылки не индексировались, к ссылкам надо добавить rel=»nofollow».
Ага, вот с чем я спутал.
Стандартный режим
Опубликовано: 08.01.2011
Влад Мержевич
Продолжая тему режимов браузера, рассмотрим стандартный режим — режим поддержки стандартов (X)HTML и CSS. Для переключения браузера в этот режим используется один из следующих доктайпов.
…
Числа без указания единиц измерения игнорируются
Если в стилях при указании размеров задано одно лишь число без упоминания единиц (width: 500 вместо width: 500px), такое значение игнорируется.
Короче лучше пиксели везде писать в любом случае .
- Quote
Link to comment
Share on other sites
- 0
-
- Report
- Share
Короче лучше пиксели везде писать в любом случае
.
Нет, это неправда, атрибут height не содержит в значении никаких единиц измерения, если это не проценты. По умолчанию это пиксели.
- Quote
Link to comment
Share on other sites
- 0
-
- Report
- Share
Короче лучше пиксели везде писать в любом случае
.
Неправда, нужно везде соблюдать правила того языка, на котором пишешь. Или <table width=»500″> (HTML), или <table style=»width:500px»> (CSS), но не <table width=»500px»> (нежизнеспособный противоестественный гибрид. Другое дело, что по-хорошему явному заданию размеров в разметке вообще делать нечего…
- Quote
Link to comment
Share on other sites
- 0
-
- Report
- Share
Сорь, видимо, не так понял.
- Quote
Link to comment
Share on other sites
Join the conversation
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
-
Обсуждения
-
By
seoreef · Posted May 30
Первый вопрос который задают новые и старые заказчики.
А вы используете Chat GPT?
Хочу всем ответить сразу: нет, мы не используем.Второй вопрос, почему?
Тут тоже довольно простой ответ: мы делаем лучше.Ситуация с ИИ на самом деле интересная, качество текста при правильно составленном запросе высокое, но то, что это сделал не человек, очевидно даже без проверки специальными сервисами.
Кстати, я оставлю на ваше усмотрение игру в рулетку с поисковыми системами, когда этот контент начнут понижать в выдаче по умолчанию.Ну и третий вопрос: а можете?
Можем, но зачем? Вы хотите удешевить текст? Сильно удешевить не получится, в нормальном ТЗ прописаны множество условий, наличие и плотность ключевых слов, заголовки и последовательность, структура статьи, использование ссылок на авторитетные источники, а так же многое другое. ИИ- помощник, но не замена. В любом случае редактор будет писать запросы и собирать итоговый текст, проверять факты, что выдал ИИ. А это все время, которое стоит денег.Контакты https://t.me/D007user
-
-
By
Katerina23 · Posted May 27
Здравствуйте, вот два блока div «class=block1» и «class=block2″, как их расположить вместе?
<div class=»test»>
<div class=»block1″ style=»background-color: rgb(210, 180, 140);»>
<p contenteditable=»true»><br></p>
</div>
<div class=»block2″>
<button class=»delete»>X</button>
</div>
</div><div class=»test»>
<div class=»block1″ style=»background-color: rgb(210, 180, 140);»>
<p contenteditable=»true»><br></p>
</div>
<div class=»block2″>
<button class=»delete»>X</button>
</div>
</div>Пример ниже:
-
By
alsmd23 · Posted May 20
Здравствуйте. Пытаюсь выстроить фоновую картинку так чтобы она была на высоту экрана устройства и закрепленная, то есть при прокрутке страницы всегда оставалась в одном месте.
Вот пример — https://jsfiddle.net/98nym4go/
Как только устанавливаю «background-attachment:fixed;» фоновая картинка почему-то перестает отображаться, а без этого тега она не закрепляется.
Что не так?
-
By
Vlad_P · Posted May 9
Да, добавить margin для input Хотя я бы предложил сделать fieldset grid — можно б было не меняя хтмл кода выровнять поля
-
Hello,
I’m trying to get valid HTML for my homepage. The following links
opens the W3C validator with my homepages source:
http://validator.w3.org/check?uri=ht…r2.dce4u.de%2F
I get the error «there is no attribute «HEIGHT»». I need this «HEIGHT»
to get the table at least as high as the browsers display area. How
can I replace my «HEIGHT» to get the same effect?
Thank you very much in advance
CU
Manuel
—
Against-TCPA
Don’t let them take YOUR RIGHTS!
www.againsttcpa.com
Jul 23 ’05
#1
2 8537
«Manuel Reimer» <MR*****@despammed.com> wrote in message
news:2v*************@uni-berlin.de…
Hello,
I’m trying to get valid HTML for my homepage. The following links
opens the W3C validator with my homepages source:http://validator.w3.org/check?uri=ht…r2.dce4u.de%2F
I get the error «there is no attribute «HEIGHT»». I need this «HEIGHT»
to get the table at least as high as the browsers display area. How
can I replace my «HEIGHT» to get the same effect?Thank you very much in advance
As with all presentational matters, use CSS.
Jul 23 ’05
#2
looks to me like you have an extra white space between the » 100%» instead
of «100%»
punctuation is very important in html
—
..
«Manuel Reimer» <MR*****@despammed.com> wrote in message
news:2v*************@uni-berlin.de…
Hello,
I’m trying to get valid HTML for my homepage. The following links
opens the W3C validator with my homepages source:http://validator.w3.org/check?uri=ht…r2.dce4u.de%2F
I get the error «there is no attribute «HEIGHT»». I need this «HEIGHT»
to get the table at least as high as the browsers display area. How
can I replace my «HEIGHT» to get the same effect?Thank you very much in advance
CU
Manuel
—
Against-TCPA
Don’t let them take YOUR RIGHTS!
www.againsttcpa.com
Jul 23 ’05
#3
This thread has been closed and replies have been disabled. Please start a new discussion.
Similar topics
5 height=»100%» in a table — how to do it right? by: Daniel Haude | Hi guys, I’m using a height=»100%» attribute in a <table> tag to get the HTML / CSS |
17 There is no attribute «BACKGROUND» & «HEIGHT» + + + by: Torbj�rn Pettersen |
I’ve got a table where I want some of the cells to use HTML / CSS |
2 img: preserve aspect ratio but width and height=»%» by: Georg Goerg | hello, i want to make website with a top navigation bar and one on the left. but if i want to put… HTML / CSS |
3 Get «width» and «height» of text? by: Lasse Edsvik | Hello I was wondering if its possible to the «width» and «height» of a text when string sometext = «bla bla»; SolidBrush sb =… C# / C Sharp |
2 Manipulating «obj.style.height » don’t work in IE7…? by: Dag Sunde |
I have the following function to resize a div element (Content) depending on function adjustContentHeight() { Javascript |
8 What is the right way to use «height:expression(eval(…));» by: fredo | This question was asked in comp.lang.javascript with no result. In IE5.x and IE6, I want to display an image when the user rolls over a HTML / CSS |
16 Markup Validation Service ?? by: Tantale |
I used this serviec to check my webpage The result is 206 errors, most of them «end tag omitted, but OMITTAG NO was… HTML / CSS |
3 img height=»» width=»» — undefined? by: Phil Endecott | Dear Experts, It looks as if the HTML4 spec does not define a meaning for empty height HTML / CSS |
0 Basic concepts of WebLogic Admin training? by: Naresh1 | What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle… Oracle Database |
0 hi by: WisdomUfot | It’s an interesting question you’ve got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don’t have the specific technical details, Gmail likely implements measures… General |
0 One of the easiest ways to set the background color of Excel documents in Java by: Carina712 | Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important… General |
0 Mastering Python: A Versatile Programming Language for All by: Rahul1995seven |
Introduction: General |
1 Datasheet Form, iterate through records by: Johno34 |
I have this click event on my form. It speaks to a Datasheet Subform Microsoft Access / VBA |
0 hello, Is there code or static lib for hook swapchain present? by: jack2019x | hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9. C / C++ |
0 Handling .click() in the Safari browser by: DizelArs | Hi all) Faced with a problem, element.click() event doesn’t work in Safari browser. let clickEvent = new Event(‘click’, {… Javascript |
1 In Access — History for each User by: F22F35 | I am a newbie to Access (most programming for that matter). I need help in creating an Access database that keeps the history of each user in a database. For example, a user might have lesson 1 sent… Microsoft Access / VBA |
0 Adding up only highest 7 numbers in a table by: CD Tom | I have a table that can contain up to 12 entries for an individual in the number field each number can be different number I want only to add up the top 7 numbers for each individual. What’s the… General |
- Remove From My Forums
-
Question
-
User651828378 posted
Hi.
I get 7 wierd validations error from w3c, i have trying to make em but with no luck, so now i hope that U can help me.
My doctype is:<?xml version=»1.0″ encoding=»iso-8859-1″?>
<!DOCTYPE html PUBLIC «-//W3C//DTD XHTML 1.0 Strict//EN»
«http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd»>
<html xml:lang=»da»>
<head>
<title>sitecopy.png</title>
<meta http-equiv=»Content-Type» content=’text/html; charset=»iso-8859-1″‘ />This page is not Valid XHTML 1.0 Strict!
Below are the results of checking this document for
XML well-formedness and validity.- Error Line 12 column 41:
there is no attribute «align»....le width="1000px" border="0px" align="center" cellpadding="0px" cellspacing="
MY LINE IS: <table width="1000px" border="0px" align="center" cellpadding="0px" cellspacing="0px">You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the «Strict» document type with a document that uses frames (e.g.
you must use the «Transitional» document type to get the «target» attribute), or by using vendor proprietary extensions such as «marginheight» (this is usually fixed by using CSS to achieve the desired effect instead).This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.
How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using
the <embed> element to incorporate flash media in a Web page, see the
FAQ item on valid flash.✉
- Error Line 16 column 18:
there is no attribute «name».<td><img name="freespace_r1_c1" src="images/freespace_r1_c1.png" width="162p
MY LINE IS: <td><img name="freespace_r1_c1" src="images/freespace_r1_c1.png" width="162px" height="88px" border="0px" id="freespace_r1_c1" alt="" /></td>✉
- Error Line 16 column 104:
there is no attribute «border»...." width="162px" height="88px" border="0px" id="freespace_r1_c1" alt="" /></..
MY LINE IS: <td><img name="freespace_r1_c1" src="images/freespace_r1_c1.png" width="162px" height="88px" border="0px" id="freespace_r1_c1" alt="" /></td>✉
- Error Line 75 column 33:
there is no attribute «background».<td valign="top" background="images/whitespace_r4_c2.png" width="12px"></..
MY LINE IS: <td valign="top" background="images/whitespace_r4_c2.png" width="12px"></td>✉
- Error Line 75 column 69:
there is no attribute «width».... background="images/whitespace_r4_c2.png" width="12px"></td>
MY LINE IS: <td valign="top" background="images/whitespace_r4_c2.png" width="12px"></td>✉
- Error Line 81 column 31:
there is no attribute «height».<td width="361px" height="367px" bgcolor="#232323" valign="top">Vulputate
MY LINE IS: <td width="361px" height="367px" bgcolor="#232323" valign="top">✉
- Error Line 81 column 47:
there is no attribute «bgcolor»....width="361px" height="367px" bgcolor="#232323" valign="top">Vulputate consequ
MY LINE IS: <td width="361px" height="367px" bgcolor="#232323" valign="top">
- Error Line 12 column 41:
Answers
-
User-158764254 posted
when running in XHtml Strict mode, you should replace those attributes with their equivalent css
for example: bgcolor=»#232323″
becomes: style=»background-color: #232323;»-
Marked as answer by
Thursday, October 7, 2021 12:00 AM
-
Marked as answer by
-
User487807879 posted
Try with this:
style=»text-align:center;»
-
Marked as answer by
Anonymous
Thursday, October 7, 2021 12:00 AM
-
Marked as answer by
Only Visible to You and DevExpress Support
Visible to All Users
Modify
support ticket and change its visibility
Urgent
Duplicate
We have closed this ticket because another page addresses its subject:
Answers approved by DevExpress Support
Disclaimer: The information provided on DevExpress.com and its affiliated web properties is provided «as is» without warranty of any kind.
Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose.
Please refer to the DevExpress.com Website Terms of Use for more information.
Recently viewed tickets
You have yet to view any tickets.
Your search criteria do not match any tickets.
A server error occurred while processing your request. Please try again at a later time.