Coder Social home page Coder Social logo

Comments (4)

bence-szalai avatar bence-szalai commented on July 20, 2024 1

yes, it was missing - strange for not rising an error for me, probably during testing the code I already defined s. Anyway thank you very much for testing it, putting s=0 there solves the problem, :)

from data-preparation-for-ctd2.

allaway avatar allaway commented on July 20, 2024

Thanks! Writing out the csv in the next chunk also gives me a weird encoding error...are you familiar with this? :

---------------------------------------------------------------------------
UnicodeEncodeError                        Traceback (most recent call last)
<ipython-input-33-3bfaa550dd86> in <module>()
----> 1 meta_matrix.to_csv('../results/drugs_meta.csv',sep=',')

/home/ec2-user/anaconda3/envs/py2/lib/python2.7/site-packages/pandas/core/generic.pyc in to_csv(self, path_or_buf, sep, na_rep, float_format, columns, header, index, index_label, mode, encoding, compression, quoting, quotechar, line_terminator, chunksize, tupleize_cols, date_format, doublequote, escapechar, decimal)
   3018                                  doublequote=doublequote,
   3019                                  escapechar=escapechar, decimal=decimal)
-> 3020         formatter.save()
   3021 
   3022         if path_or_buf is None:

/home/ec2-user/anaconda3/envs/py2/lib/python2.7/site-packages/pandas/io/formats/csvs.pyc in save(self)
    170                 self.writer = UnicodeWriter(f, **writer_kwargs)
    171 
--> 172             self._save()
    173 
    174         finally:

/home/ec2-user/anaconda3/envs/py2/lib/python2.7/site-packages/pandas/io/formats/csvs.pyc in _save(self)
    272     def _save(self):
    273 
--> 274         self._save_header()
    275 
    276         nrows = len(self.data_index)

/home/ec2-user/anaconda3/envs/py2/lib/python2.7/site-packages/pandas/io/formats/csvs.pyc in _save_header(self)
    240         if not has_mi_columns or has_aliases:
    241             encoded_labels += list(write_cols)
--> 242             writer.writerow(encoded_labels)
    243         else:
    244             # write out the mi

UnicodeEncodeError: 'ascii' codec can't encode character u'\xd0' in position 9: ordinal not in range(128)

from data-preparation-for-ctd2.

allaway avatar allaway commented on July 20, 2024

utf-8 encoding seems to fix this!

from data-preparation-for-ctd2.

bence-szalai avatar bence-szalai commented on July 20, 2024

great! just came back to check it, but seems like its fine. thanks!

from data-preparation-for-ctd2.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.