Dataframe-With-Radom-Data
title: "DataFrame With Random Data"
author: "Rj"
date: 2019-04-24
description: "-"
type: technical_note
draft: false
import numpy as np
import pandas as pd
import random
def xrange(x):
return iter(range(x))
rnd_1 = [random.randrange(1, 20) for x in xrange(10)]
[16, 3, 18, 19, 1, 13, 17, 3 …
Read More
Dataype Downcasting
title: "Datatype Downcasting"
author: "Rj"
date: 2019-04-24
description: "-"
type: technical_note
draft: false
import numpy as np
import pandas as pd
ds = pd.Series([1, np.nan, 3, 4, 5])
0 1.0
1 NaN
2 3.0
3 4.0
4 5.0
dtype: float64
Read More
Even-Rows-And-First-3-Columns
title: "Even Rows and 3 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', sep=',', encoding='utf-8')
Read More
Fill-Na-With-Average
title: "Fill NA with Average"
author: "Rj"
date: 2019-04-22
description: "-"
type: technical_note
draft: false
import numpy as np
import pandas as pd
df = pd.read_csv('abc2.csv')
|
student |
language |
science |
maths … |
Read More
Fill-Random-Marks
title: "Fill Random Marks"
author: "Rj"
date: 2019-04-22
description: "-"
type: technical_note
draft: false
import numpy as np
import pandas as pd
datatype = [('Science', 'int32'), ('Maths', 'int32')]
current_values = np.zeros(3, dtype=datatype)
current_index = ['Row '+str(i) for i in range(1, 4)]
df = pd.DataFrame(current_values, index=current_index)
Read More
Filter-Between
title: "Filter Between"
author: "Rj"
date: 2019-04-24
description: "-"
type: technical_note
draft: false
import numpy as np
import pandas as pd
df = pd.read_csv('marks.csv')
|
student |
language |
science |
maths |
history |
| 0 … |
Read More
Filter-By-Single-Column
title: "Filter by single 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')
Read More
Filter-With-Query
title: "Filter with Query"
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 |
maths |
history … |
Read More
Filter-With-Value-Comparison
title: "Filter With Value Comparison"
author: "Rj"
date: 2019-04-24
description: "-"
type: technical_note
draft: false
import numpy as np
import pandas as pd
df = pd.read_csv('abc.csv')
|
student |
language |
science |
maths … |
Read More
First-Four-Rows-Of-Csv
title: "First Four Rows of CSV"
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