본문 바로가기

Data/Python

[Python] splitlines, pandas

목차

    반응형

    splitlines

    문자열이 만약 여러줄로 나뉘어져있을때, splitlines를 활용하여 바로 배열형식으로 바꿔줄수가 있다

    a = """hi
    what
    is
    your
    name?
    haha
    """
    
    a.splitlines()
    # ['hi', 'what', 'is', 'your', 'name?', 'haha']

    pandas Dataframe column별 null개수

    np.sum(df.isnull())
    # df->pandas.DataFrame
    반응형