<div dir="ltr"><div>Hi Şükrü,</div><div><br></div><div><span class="gmail-short_text" id="gmail-result_box" lang="en"><span>I realized I needed to use space as a delimiter, </span><span class="gmail-short_text" id="gmail-result_box" lang="en"><span>problem solved.</span></span></span></div><div><span class="gmail-short_text" lang="en"><span class="gmail-short_text" lang="en"><span><br></span></span></span></div><div>Thanks for your help, it is really appreciated.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 10, 2017 at 2:37 PM, Şükrü Bezen <span dir="ltr"><<a href="mailto:sukru@sukrubezen.com" target="_blank">sukru@sukrubezen.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<br><br>You may have one last separator at the end of every row in your data which makes your rows create one extra empty entity which results with that error.<br>Or maybe your data can not be cast into float?<br><br>If you provide an example row, I could help more.<br><br>Best,</div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On Mon, Apr 10, 2017 at 2:29 PM, Sema Atasever <span dir="ltr"><<a href="mailto:s.atasever@gmail.com" target="_blank">s.atasever@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Dear Manoj,<div><br></div><div>Thanks for your answer but when i execute the code below i get this error :  "<b>ValueError: could not convert string to float:</b>"</div><div><br></div><div>How can i solve this error.</div><div><br></div><div>Regards.</div><div><br></div><div>------------------------------<wbr>---------------</div><div><div>from sklearn.cluster import Birch</div><div>from io import StringIO</div><div>import numpy as np</div><div><br></div><div>X=np.loadtxt(open("C:\features<wbr>.dat", "rb"), delimiter="\t")<br></div><div><br></div><div><br></div><div>brc = Birch(branching_factor=50, n_clusters=None, threshold=0.5,compute_labels=T<wbr>rue)</div><div>brc.fit(X)</div><div>Birch(branching_factor=50, compute_labels=True, copy=True, n_clusters=None,threshold=0.5)</div><div>brc.predict(X)</div><div><br></div><div>print(brc.predict(X))</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 6, 2017 at 4:29 PM, Manoj Kumar <span dir="ltr"><<a href="mailto:manojkumarsivaraj334@gmail.com" target="_blank">manojkumarsivaraj334@gmail.co<wbr>m</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi, See: <a href="https://docs.scipy.org/doc/numpy/reference/generated/numpy.loadtxt.html" target="_blank">https://docs.scipy.org/doc/num<wbr>py/reference/generated/numpy.l<wbr>oadtxt.html</a> for one way.<br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_5892867172828839711m_1793221407800584409h5">On Thu, Apr 6, 2017 at 8:27 AM, Sema Atasever <span dir="ltr"><<a href="mailto:s.atasever@gmail.com" target="_blank">s.atasever@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_5892867172828839711m_1793221407800584409h5"><div dir="ltr"><span style="font-size:12.8px">Dear </span><span class="m_5892867172828839711m_1793221407800584409m_4587896749118386380m_-5250678994509259399gmail-il" style="font-size:12.8px">scikit</span><span style="font-size:12.8px">-learn members,</span><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">I have a dat file where the columns represent the features and the rows represent the protein. (you can see the dat file in the attachment)</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">i want to use <b>sklearn.cluster.Birch</b> with this text file values as X which is the</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Parameters:<span class="m_5892867172828839711m_1793221407800584409m_4587896749118386380m_-5250678994509259399gmail-m_2321009139742540830gmail-Apple-tab-span" style="white-space:pre-wrap">     </span></div><div style="font-size:12.8px">X : {array-like, sparse matrix}</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">How can i transform this text file values into X : {array-like, sparse matrix}. </div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><div style="font-size:12.8px">I would appreciate if you could advise on some methods.<br></div></div><div style="font-size:12.8px"><span style="font-size:12.8px">Thanks.</span></div></div>
<br></div></div>______________________________<wbr>_________________<br>
scikit-learn mailing list<br>
<a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/scikit-learn" target="_blank" rel="noreferrer">https://mail.python.org/mailma<wbr>n/listinfo/scikit-learn</a><br>
<br></blockquote></div><span class="m_5892867172828839711m_1793221407800584409HOEnZb"><font color="#888888"><br><br clear="all"><span class="m_5892867172828839711HOEnZb"><font color="#888888"><br>-- <br><div class="m_5892867172828839711m_1793221407800584409m_4587896749118386380gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div>Manoj,<br><a href="http://github.com/MechCoder" target="_blank">http://github.com/MechCoder</a><br></div></div></div></div></div></div>
</font></span></font></span></div><span class="m_5892867172828839711HOEnZb"><font color="#888888">
<br>______________________________<wbr>_________________<br>
scikit-learn mailing list<br>
<a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/scikit-learn" target="_blank" rel="noreferrer">https://mail.python.org/mailma<wbr>n/listinfo/scikit-learn</a><br>
<br></font></span></blockquote></div><br></div>
<br>______________________________<wbr>_________________<br>
scikit-learn mailing list<br>
<a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/scikit-learn" target="_blank" rel="noreferrer">https://mail.python.org/mailma<wbr>n/listinfo/scikit-learn</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br></div></div><div class="m_5892867172828839711gmail_signature" data-smartmail="gmail_signature">------------------------------<wbr>--------------------<br>Şükrü BEZEN<br></div>
</div>
<br>______________________________<wbr>_________________<br>
scikit-learn mailing list<br>
<a href="mailto:scikit-learn@python.org">scikit-learn@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/scikit-learn" target="_blank" rel="noreferrer">https://mail.python.org/<wbr>mailman/listinfo/scikit-learn</a><br>
<br></blockquote></div><br></div>