Last-N-Rows
title: "Last N Rows"
author: "Rj"
date: 2019-04-22
description: "-"
type: technical_note
draft: false
import numpy as np
import pandas as pd
df = pd.read_csv('data1.csv')
|
capacity |
score |
length |
| 0 |
1 … |
Read More
Last-Nth-To-First-Row
title: "Last nth to last second"
author: "Rj"
date: 2019-04-22
description: "-"
type: technical_note
draft: false
import numpy as np
import pandas as pd
df = pd.read_csv('data1.csv')
Read More
Loc With Boolean
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 …
Read More
Max-As-New-Column
title: "Max as a New Column"
author: "Rj"
date: 2019-04-22
description: "-"
type: technical_note
draft: false
import numpy as np
import pandas as pd
df = pd.read_csv('abc.csv')
|
student |
language |
science … |
Read More
Min-Max-Avg-As-New-Columns
title: "Min Max Avg as new Columns"
author: "Rj"
date: 2019-04-22
description: "-"
type: technical_note
draft: false
import numpy as np
import pandas as pd
df = pd.read_csv('abc.csv')
Read More
Nth-Row
title: "Get Nth row"
author: "Rj"
date: 2019-04-22
description: "-"
type: technical_note
draft: false
import numpy as np
import pandas as pd
df = pd.read_csv('data1.csv')
|
capacity |
score |
length |
| 0 |
1 … |
Read More
Pandas Version
title: "Pandas Version"
author: "Rj"
date: 2019-04-24
description: "-"
type: technical_note
draft: false
pd.show_versions(as_json=False)
INSTALLED VERSIONS
------------------
commit: None
python: 3.6.8.final.0
python-bits: 64
OS: Darwin
OS-release: 18.5.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL …
Read More
Pandas-With-Numpy-Zeros
title: "Pandas with Numpy Zeros"
author: "Rj"
date: 2019-04-20
description: "-"
type: technical_note
draft: false
import numpy as np
import pandas as pd
dtype = [('Col1','int32'), ('Col2','float32'), ('Col3','float32')]
values = np.zeros(20, dtype=dtype)
index = ['Row'+str(i) for i in range(1, len(values)+1)]
Read More
Pandas-With-Random-Int
title: "Pandas with Random Int"
author: "Rj"
date: 2019-04-22
description: "-"
type: technical_note
draft: false
import numpy as np
import pandas as pd
df = pd.DataFrame(np.random.randint(0, 100, size=(3, 2)), columns=list('xy'))
Read More
Random-Int-Single-Param
title: "Random Param Single Param"
author: "Rj"
date: 2019-04-22
description: "-"
type: technical_note
draft: false
import numpy as np
import pandas as pd
df = pd.DataFrame(np.random.randint(5, size = (5, 4)))
Read More