Food Points

Sat 17 May 2025

title: "Food Points" author: "Rj" date: 2019-04-24 description: "-" type: technical_note draft: false


import numpy as np
import pandas as pd
data = {
    'dinner' : ['chicken wrap', 'stake', 'rudy burger', 'sushi', 'chicken teriyaki', 'caesar salad']
}
df = pd.DataFrame(data)
df

Category: data-wrangling

Read More

Gruopby Date

Sat 17 May 2025

title: "Groupby Date" author: "Rj" date: 2019-04-20 description: "List Test" type: technical_note draft: false


from datetime import datetime
import pandas as pd
data = {
    'date' : [
        '2019-05-01 19:47:05.069722', 
        '2019-05-02 17:47:05.069722', 
        '2019-05-02 19:47:05.069722',
        '2019-05-03 18:47:05.069722',
        '2019-05-03 19:47:05.069722',
    ],
    'spent …

Category: data-wrangling

Read More

If-Else-Pandas

Sat 17 May 2025

title: "If Else Pandas" author: "Rj" date: 2019-04-24 description: "-" type: technical_note draft: false source: http://pandas.pydata.org/pandas-docs/version/0.24/user_guide/cookbook.html#idioms


import numpy as np
import pandas as pd
df = pd.DataFrame({
    'maths' : [80, 89, 90, 20],
    'science' : [40, 50, 90, 100],
    'language' : [20, 30 …

Category: data-wrangling

Read More

If Then

Sat 17 May 2025

title: "Template" author: "Rj" date: 2019-04-24 description: "-" type: technical_note draft: false source: http://pandas.pydata.org/pandas-docs/version/0.24/user_guide/cookbook.html#idioms


import numpy as np
import pandas as pd
df = pd.read_csv('abc.csv')
df

Category: data-wrangling

Read More

Iloc

Sat 17 May 2025

title: "iLoc Simple" author: "Rj" date: 2019-04-20 description: "-" type: technical_note draft: false


import pandas as pd
df = pd.read_csv('data1.csv', sep=',', header=None)
df
0 1 2
0 capacity score length …

Category: data-wrangling

Read More

Iloc-Position-Slice

Sat 17 May 2025

title: "iLoc Position Slice" author: "Rj" date: 2019-04-24 description: "-" type: technical_note draft: false


import numpy as np
import pandas as pd
df = pd.read_csv('data1.csv')
df
capacity score length
0 1 …

Category: data-wrangling

Read More

Index Isin

Sat 17 May 2025

title: "Index isin" author: "Rj" date: 2019-04-24 description: "-" type: technical_note draft: false source: http://pandas.pydata.org/pandas-docs/version/0.24/user_guide/cookbook.html#idioms


import numpy as np
import pandas as pd
df = pd.DataFrame({
    'maths' : [80, 89, 90, 20, 60],
    'science' : [40, 50, 90, 100, 50],
    'language' : [20 …

Category: data-wrangling

Read More

Infer Objects

Sat 17 May 2025

title: "Infer Objects" author: "Rj" date: 2019-04-24 description: "-" type: technical_note draft: false


import numpy as np
import pandas as pd
df = pd.DataFrame({'a': [7, 1, 5], 'b': ['3','2','1']}, dtype='object')
df

Category: data-wrangling

Read More

Initialize With Datatype

Sat 17 May 2025

title: "Initalize With DataType" author: "Rj" date: 2019-04-24 description: "-" type: technical_note draft: false


import numpy as np
import pandas as pd
df = pd.DataFrame({'a': [7, 1, 5], 'b': ['3','2','1']}, dtype='object')
df

Category: data-wrangling

Read More

Int And Nan

Sat 17 May 2025

title: "Int and NaN" author: "Rj" date: 2019-04-24 description: "-" type: technical_note draft: false


import numpy as np
import pandas as pd
df = pd.DataFrame({
    'one': [4, 5],
    'two': [10, 20]
})
df
one …

Category: data-wrangling

Read More
Page 3 of 6

« Prev Next »