---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-1-f50ae39b9200> in <module>()
1 import pandas
----> 2 data = pandas . read_csv ( "titanic.csv " , index_col="PassengerId " )
D:\Anaconda\lib\site-packages\pandas\io\parsers.py in parser_f(filepath_or_buffer, sep, delimiter, header, names, index_col, usecols, squeeze, prefix, mangle_dupe_cols, dtype, engine, converters, true_values, false_values, skipinitialspace, skiprows, nrows, na_values, keep_default_na, na_filter, verbose, skip_blank_lines, parse_dates, infer_datetime_format, keep_date_col, date_parser, dayfirst, iterator, chunksize, compression, thousands, decimal, lineterminator, quotechar, quoting, escapechar, comment, encoding, dialect, tupleize_cols, error_bad_lines, warn_bad_lines, skipfooter, skip_footer, doublequote, delim_whitespace, as_recarray, compact_ints, use_unsigned, low_memory, buffer_lines, memory_map, float_precision)
653 skip_blank_lines=skip_blank_lines)
654
--> 655 return _read(filepath_or_buffer, kwds)
656
657 parser_f.__name__ = name
D:\Anaconda\lib\site-packages\pandas\io\parsers.py in _read(filepath_or_buffer, kwds)
409
410 try:
--> 411 data = parser.read(nrows)
412 finally:
413 parser.close()
D:\Anaconda\lib\site-packages\pandas\io\parsers.py in read(self, nrows)
1003 raise ValueError('skipfooter not supported for iteration')
1004
-> 1005 ret = self._engine.read(nrows)
1006
1007 if self.options.get('as_recarray'):
D:\Anaconda\lib\site-packages\pandas\io\parsers.py in read(self, nrows)
1824
1825 names, data = self._do_date_conversions(names, data)
-> 1826 index, names = self._make_index(data, alldata, names)
1827
1828 # maybe create a mi on the columns
D:\Anaconda\lib\site-packages\pandas\io\parsers.py in _make_index(self, data, alldata, columns, indexnamerow)
1333
1334 elif not self._has_complex_date_col:
-> 1335 index = self._get_simple_index(alldata, columns)
1336 index = self._agg_index(index)
1337
D:\Anaconda\lib\site-packages\pandas\io\parsers.py in _get_simple_index(self, data, columns)
1367 index = []
1368 for idx in self.index_col:
-> 1369 i = ix(idx)
1370 to_remove.append(i)
1371 index.append(data[i])
D:\Anaconda\lib\site-packages\pandas\io\parsers.py in ix(col)
1361 if not isinstance(col, compat.string_types):
1362 return col
-> 1363 raise ValueError('Index %s invalid' % col)
1364 index = None
1365
ValueError: Index PassengerId invalid
np.sum(Z, axis=1)в дополнительные скобки
(np.sum(Z, axis=1))
bob = ['Bob Smith',42,30000,'software']
sue = ['Sue Jones',45,40000,'hardware']
bob[0], sue[2] # получить имя и оклад
bob[0].split()[-1] # получить фамилию Боба
sue[2] *= 1.25 # повысить оклад Сью на 25%
sue ['Sue Jones',45,50000.0,'hardware']