text_plain_output_1.png
import pandas as pd

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

import re

df = pd.read_csv('../input/titanic/train.csv')

df2 = pd.read_csv('/kaggle/input/titanic/train.csv')

chunker = pd.read_csv('../input/titanic/train.csv', chunksize=1000)

column_text = 'PassengerId => 乘客ID\n                Survived => 是否幸存\n                Pclass => 乘客等级(1/2/3等舱位)\n                Name => 乘客姓名\n                Sex => 性别\n                Age => 年龄\n                SibSp => 堂兄弟/妹个数\n                Parch => 父母与小孩个数\n                Ticket => 船票信息\n                Fare => 票价\n                Cabin => 客舱\n                Embarked => 登船港口'
column_list = [re.sub('.*=> ', '', name) for name in column_text.split('\n')]
df.columns = column_list
df.set_index('乘客ID', inplace=True)

df.isnull()

df.to_csv('train_chinese.csv')

a = [1, 2, 3, 4]
b = ['a', 'b', 'c', 'd']
pd.Series(dict(zip(a, b)))

a = ['x', 'y', 'z']
b = [['a', 'b', 'c'], [1, 2, 3], ['o', 'p', 'q']]
pd.DataFrame(dict(zip(a, b))).set_index('y')

df = pd.read_csv('../input/titanic/train.csv')
df_c = pd.read_csv('train_chinese.csv')

(list(df.columns), list(df_c.columns))

df.Cabin

test_1 = df
test_1['a'] = 100

del test_1['a']
test_1.head()